#include <bits/stdc++.h>
using namespace std;
int main() {
  int num_0 = 0;
  int num_1 = 0;
  int S;
  string S_st;
  int ans;
  int len_S;
  cin >> S_st;
  S = stoi(S_st, 0, 2);
  len_S = S_st.size();
  num_1 = __builtin_popcount(S);
  num_0 = len_S - num_1;
  ans = len_S - abs(num_1 - num_0);
  cout << ans << endl;
}
