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