#include <bits/stdc++.h>
using namespace std;
const int INF = 1000000000;
const long long LINF = 1000000000000000000;
const double EPS = 1e-10;
int main(void) {
  string S;
  cin >> S;
  deque<char> box;
  int zero = 0;
  int one = 0;
  for (int i = 0; i < S.size(); i++) {
    box.push_back(S[i]);
    if (S[i] == '0') {
      zero++;
    } else {
      one++;
    }
  }
  int diff = abs(zero - one);
  int cnt = 0;
  while (true) {
    for (int i = 0; i < box.size() - 1; i++) {
      if (box[i] == '0' && box[i + 1] == '1') {
        box.erase(box.begin() + i);
        box.erase(box.begin() + i + 1);
        cnt++;
      } else if (box[i] == '1' && box[i + 1] == '0') {
        box.erase(box.begin() + i);
        box.erase(box.begin() + i + 1);
        cnt++;
      }
      if (box.empty() || box.size() == diff) {
        break;
      }
    }
    if (box.empty() || box.size() == diff) {
      break;
    }
  }
  int ans = cnt * 2;
  cout << ans << endl;
  return (0);
}
