#include <bits/stdc++.h>
using namespace std;
constexpr long long MOD = 1000000007;
using ll = long long;
int main() {
  string s;
  cin >> s;
  ll n = s.size();
  ll dp[n + 1];
  string st;
  for (ll i = 0; i < n + 1; i++) dp[i] = 0;
  dp[0] = 1;
  st.push_back(s[0]);
  map<string, bool> appeared;
  for (ll i = 0; i < n; i++) {
    if (!appeared[st]) {
      appeared[st] = true;
      dp[i + 1] = dp[i] + 1;
      st = s[i + 1];
    } else {
      dp[i + 1] = dp[i];
      st += s[i + 1];
    }
  }
  cout << dp[n - 1] << endl;
}
