#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  int n = s.size();
  for (int i = 0; i < s.size() - 1; i++) {
    if ((s.at(i) == '0' && s.at(i + 1) == '1') ||
        (s.at(i) == '1' && s.at(i + 1) == '0')) {
      s = s.erase(i, 2);
      i = 0;
      if (s == "") {
        break;
      }
    }
  }
  if (s == "") {
    cout << n << endl;
  } else {
    cout << n - s.size() << endl;
  }
}
