#include <bits/stdc++.h>
using namespace std;
const int MOD = (int)1e9 + 7;
int main() {
  string s;
  cin >> s;
  char buf = s[0];
  int count = 0;
  bool flag = true;
  for (int i = 0; i < (int)(s.size()); i++) {
    if (i == 0) continue;
    if (buf != s[i] && flag) {
      count += 2;
      flag = false;
    }
    flag = true;
  }
  cout << count << endl;
}
