#include<iostream>
#include<map>
#include<string>
using namespace std;
int main()
{
string str;
cin>>str;
map<char,int> mp;
for(int i=0;i<str.size();i++)
{
mp[str[i]]++;
}
int max=0;
for(auto i=mp.begin();i!=mp.end();i++)
{
max = max < (*i).second ? (*i).second : max;
}
cout<<max;
}