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