#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  int a = 1, p = 0;
  for (int i = p; i < s.size(); i++) {
    set<char> w;
    queue<char> x;
    w.insert(s.at(i));
    x.push(s.at(i));
    if (w.size() != x.size()) {
      p = i;
      a++;
    }
  }
  cout << a << endl;
}
