#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  int originalSize = s.size();
  bool trimmed = false;
  while (true) {
    trimmed = false;
    for (int i = 0; i < s.size(); i++) {
      if (s[i] == '0' && s[i + 1] == '1') {
        s.erase(i, 2);
        trimmed = true;
        break;
      } else if (s[i] == '1' && s[i + 1] == '0') {
        s.erase(i, 2);
        trimmed = true;
        break;
      }
    }
    if (!trimmed) {
      break;
    }
  }
  int finalSize = s.size();
  cout << originalSize - finalSize << "\n";
}
