#include <iostream>
#include<bits/stdc++.h>
using namespace std;
int main() {
// your code goes here
string str;
cin>>str;
int max1=INT_MIN;
for(int i=0;i<str.size();i++){
set<char>s;
int j=i+1;
s.insert(str[i]);
while(j<str.size()){
int size=s.size();
s.insert(str[j]);
if(s.size()==size){
break;
}
j++;
}
int si=s.size();
max1=max(max1,si);
}
cout<<max1<<" ";
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZTxiaXRzL3N0ZGMrKy5oPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKaW50IG1haW4oKSB7CgkvLyB5b3VyIGNvZGUgZ29lcyBoZXJlCglzdHJpbmcgc3RyOwoJY2luPj5zdHI7CglpbnQgbWF4MT1JTlRfTUlOOwoJZm9yKGludCBpPTA7aTxzdHIuc2l6ZSgpO2krKyl7CgkgICAgICAgc2V0PGNoYXI+czsKCQkgICBpbnQgaj1pKzE7CgkJICAgcy5pbnNlcnQoc3RyW2ldKTsKCQkgICAgd2hpbGUoajxzdHIuc2l6ZSgpKXsKCQkgICAgaW50IHNpemU9cy5zaXplKCk7CgkJICAgIHMuaW5zZXJ0KHN0cltqXSk7CgkJICAgIGlmKHMuc2l6ZSgpPT1zaXplKXsKCQkgICAgCWJyZWFrOwoJCSAgICB9CgkJICAgCWorKzsKCQkgICB9CgkJICAgaW50IHNpPXMuc2l6ZSgpOwoJCSAgbWF4MT1tYXgobWF4MSxzaSk7Cgl9Cgljb3V0PDxtYXgxPDwiICI7CglyZXR1cm4gMDsKfQ==