#include <bits/stdc++.h>
using namespace std;
string s;
int main() {
  cin >> s;
  int prefix = s.length();
  for (int i = 0; i <= s.length(); i++) {
    if ((s[i] == '0' && s[i + 1] == '1') || (s[i] == '1' && s[i + 1] == '0')) {
      s.erase(s.begin() + i, s.begin() + i + 2);
      i = -1;
    }
  }
  cout << prefix - s.length();
}
