#include <bits/stdc++.h>
using namespace std;
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  string S;
  cin >> S;
  bool has01 = true;
  int cnt = 0;
  while (has01) {
    has01 = false;
    for (int i = 0; i < S.length() - 1; i++) {
      if (S[i] != S[i + 1]) {
        S.erase(S.begin() + i + 1);
        S.erase(S.begin() + i);
        cnt += 2;
        has01 = true;
        break;
      }
    }
  }
  cout << cnt << endl;
}
