#include <bits/stdc++.h>
using namespace std;
int static fast = []() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  return 0;
}();
int main() {
  string s;
  cin >> s;
  string s2;
  int ans = 0;
  for (char c : s) {
    if (!s2.empty() && s2.back() != c) {
      ans += 2;
    } else {
      s2 += c;
    }
  }
  cout << ans << endl;
  return 0;
}
