#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  int dp[2 * 100001] = {};
  dp[0] = 1;
  for (int i = 1; i < s.size(); ++i) {
    dp[i] = (s[i] == s[i - 1] ? dp[i - 1] : dp[i - 1] + 1);
  }
  cout << dp[s.size() - 1] + 1 << endl;
  return 0;
}
