#include <bits/stdc++.h>
using namespace std;
int main() {
  string S;
  cin >> S;
  int cnt1 = 0;
  int cnt2 = 0;
  for (int i = 0; i < S.size(); i++) {
    if (S[i] == 0) {
      cnt1++;
    } else if (S[i] == 1) {
      cnt2++;
    }
  }
  cout << cnt1 + cnt2 - max(cnt1, cnt2) + min(cnt1, cnt2) << endl;
  return 0;
}
