#include <iostream>
#include <deque>
using namespace std;
int main(){
deque<int> folder;
unsigned long long N;
cin >> N;
folder.push_back(N%10);
N/=10;
while (N!=0){
for (int i=0; i<folder.size(); i++){
if (folder.at(i) == N%10)
i+=folder.size();
if (i == folder.size() -1)
folder.push_back(N%10);
}
N/=10;
}
cout << "sum:" << folder.size();
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8ZGVxdWU+CnVzaW5nIG5hbWVzcGFjZSBzdGQ7CiAKaW50IG1haW4oKXsKCWRlcXVlPGludD4gZm9sZGVyOwogICAgdW5zaWduZWQgbG9uZyBsb25nIE47CiAgICAKICAgIGNpbiA+PiBOOwogICAgZm9sZGVyLnB1c2hfYmFjayhOJTEwKTsKCU4vPTEwOwoJd2hpbGUgKE4hPTApewoJCWZvciAoaW50IGk9MDsgaTxmb2xkZXIuc2l6ZSgpOyBpKyspewoJCQlpZiAoZm9sZGVyLmF0KGkpID09IE4lMTApCgkJCQlpKz1mb2xkZXIuc2l6ZSgpOwkKCQkJaWYgKGkgPT0gZm9sZGVyLnNpemUoKSAtMSkKCQkJCWZvbGRlci5wdXNoX2JhY2soTiUxMCk7CgkJfQogICAgICAgIE4vPTEwOwogICAgfQogCWNvdXQgPDwgInN1bToiIDw8IGZvbGRlci5zaXplKCk7CiAKICAgIHJldHVybiAwOwp9