/+ dub.sdl:
    name "E"
    dependency "dcomp" version=">=0.3.2"
    lflags "-stack_size" "100000000"
+/
 
import std.algorithm, std.conv, std.range, std.stdio;
import std.string;

int main(string[] argv) {
    string s = readln.strip;
    int n = s.length.to!int;
    int ma = 0;
    foreach (u; 1..n+1) {
        string[] sl;
        foreach (l; 0..n-u+1) {
            sl ~= s[l..l+u];
        }
        ma = max(ma, sort(sl).uniq.array.length.to!int);
    }
    writeln(ma);
    return 0;
}
