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