#include <bits/stdc++.h>
using namespace std;
using ll = long long;
constexpr ll MOD = 1000000007;
constexpr ll INF = 1050000000;
constexpr ll LONGINF = 1050000000000000000;
int main() {
  string s;
  cin >> s;
  int ans = 0;
  for (int i = 0; i < s.size() - 1; i++) {
    string a = s.substr(i, 1);
    string b = s.substr(i + 1, 1);
    if (a == b) {
      ans += 2;
      i += 2;
    } else {
      ans += 2;
      i++;
    }
  }
  cout << ans << endl;
  return 0;
}
