#include <bits/stdc++.h>
using namespace std;
int main() {
  char S[100001];
  cin >> S;
  int N = strlen(S);
  vector<int> vt;
  for (int i = 0; i < N; i++) {
    if (S[i] == '0') {
      vt.push_back(0);
    } else {
      vt.push_back(1);
    }
  }
  int flag = 0;
  int ans = 0;
  int tmp = vt[0];
  while (ans + flag < N) {
    flag++;
    if (flag == 0) {
      tmp = vt[0];
    } else {
      if (tmp != vt[flag]) {
        vt.erase(vt.begin() + flag);
        vt.erase(vt.begin() + flag - 1);
        flag -= 2;
        ans += 2;
      }
    }
  }
  cout << ans << endl;
  return 0;
}
