#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  int a = 0;
  int N;
  N = s.length();
  for (int i = 0; i < N - 1; i++) {
    if (i == 0) {
      if (s[i] != s[i + 1]) {
        a += 2;
        i++;
      }
    } else {
      if (s[i] != s[i + 1]) {
        a += 2;
        s[i + 1] = s[i - 1];
      }
    }
  }
  cout << a << endl;
}
