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