#include <bits/stdc++.h>
using namespace std;
const int INF = 100100100;
const long LONG_INF = 2147483647;
const int MOD = (int)1e9 + 7;
const double EPS = 1e-9;
const long long LINF = 1e18;
int pow(int x) {
  if (x == 0) {
    return 1;
  } else {
    return pow(x - 1) * 2;
  }
}
int main(int argc, char const *argv[]) {
  cin.tie(0);
  ios::sync_with_stdio(false);
  string x;
  cin >> x;
  int count = 0;
  for (long(i) = 0; (i) < (long)(x.length() - 1); (i)++) {
    if (x.substr(i, 1) == x.substr(i + 1, 1)) {
      count += 2;
      x = x.substr(0, i) + x.substr(i + 2, x.length() - i - 1);
      i--;
      if (i >= 0) {
        i--;
      }
    }
  }
  cout << count << endl;
  return 0;
}
