#include <bits/stdc++.h>
using namespace std;
int main() {
  int l, r;
  string a;
  int cnt = 0;
  cin >> a;
  for (int i = 0; i <= a.size(); ++i) {
    if (a[i] != a[i + 1]) {
      a.erase(i, i + 1);
      cnt += 2;
    }
  }
  cout << cnt;
}
