#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5;
int n, m, x, a[N], tc, k;
long long freq[N + 2];
vector<int> g[N];
bool vis[N];
string ch;
int getLen(int i, char l) {
  if (i == ch.length()) return 1;
  if (ch[i] != l) return 1 + getLen(i + 1, ch[i]);
  return getLen(i + 1, l);
}
map<char, int> mp;
int main() {
  cin >> ch;
  for (int i = 0; i < ch.length(); i++) mp[ch[i]]++;
  cout << getLen(1, ch[0]) + (mp[ch[0]] < ch.length());
}
