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