#include <bits/stdc++.h>
using namespace std;
const int INF = 1 << 30;
const int MOD = 1e9 + 7;
const int dy[] = {1, 0, -1, 0};
const int dx[] = {0, 1, 0, -1};
void solve(string s) {
  string res = "";
  res += s[0];
  long long ans = 0;
  for (int i = 1; i < s.size(); i++) {
    if (s[i] != res.back()) {
      ans += 2;
    } else {
      res += s[i];
    }
  }
  cout << ans << endl;
}
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  string s;
  cin >> s;
  solve(s);
  return 0;
}
