#include <bits/stdc++.h>
typedef long long LL;
#define SORT(c) sort((c).begin(),(c).end())

#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)

using namespace std;
int charas[256];
int main(void)
{
  char c;
  for(int i=0;i<256;++i) charas[i]=0;
  while(cin >> c) charas[c]++;
  int answer=0;
  for(int i=0;i<250;++i){
    if(charas[i]&&charas[i+1]&&charas[i+2]){
      answer+=3;
      for(int j=i;j<250;++j){
	if(charas[j]==0) break;
	charas[j]--;
      }
      i=0;
    }
  }
  for(int i=0;i<256;++i) answer+=charas[i];
  cout << answer << endl;
  return 0;
}