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