#include<iostream>
#include<algorithm>
#include<set>

using namespace std;

int main(){
  multiset<char> ms;
  char S[123];
  cin>>S;
  for(auto p=S;*p;p++){
    ms.insert(*p);
  }
  int ans=0;
  while(!ms.empty()){
    auto it=ms.begin();
    char c=*it;
    int cn=1;
    for(;;){
      ms.erase(it);
      it=ms.find(c+1);
      if(it==ms.end())break;
      c++;
      cn++;
    }
    ans+=min(3,cn);
  }
  cout<<ans<<endl;
}