#include <bits/stdc++.h>
using namespace std;
int main() {
  string S;
  cin >> S;
  int ans = 0;
  bool loop = true;
  string t = S;
  while (loop) {
    int i = t.find("01");
    int j = t.find("10");
    int x;
    if (i >= 0 && j >= 0)
      x = min(i, j);
    else if (i >= 0 && j < 0)
      x = i;
    else if (i < 0 && j >= 0)
      x = j;
    else {
      loop = false;
      continue;
    }
    t = t.erase(x, 2);
    ans++;
    if (t.size() <= 1) break;
  }
  cout << ans * 2 << endl;
  return 0;
}
