#include <bits/stdc++.h>
using namespace std;
string s;
int main() {
  cin >> s;
  int ans = s.size();
  while (s.find("10") != string::npos || s.find("01") != string::npos) {
    int id1 = -1, id2 = -1;
    if (s.find("10") != string::npos) id1 = s.find("10");
    if (s.find("01") != string::npos) id2 = s.find("01");
    int id = 1000000007;
    if (id1 != -1) id = id1;
    if (id2 != -1) id = min(id, id2);
    s.erase(s.begin() + id);
    s.erase(s.begin() + id);
  }
  cout << ans - s.size() << endl;
  return 0;
}
