#include <bits/stdc++.h>
using namespace std;

int main() {
  string s;
  cin >> s;
  int a = 1;
  for(int i = 0; i < s.size(); i++){
    unordered_set<char> w;
    deque<char> x;
    w.insert(s.at(i));
    x.push(s.at(i));
    if(w.size() != x.size()){
      p = i;
      w.clear();
      x.clear();
      a++;
    }
  }
  cout << a << endl;
}
