#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  vector<char> s, ans;
  string S;
  cin >> S;
  N = S.size();
  for (int i = 0; i < N; i++) {
    s.push_back(S[i]);
  }
  int i = 1;
  while (s.size() != i) {
    if ((s[i] == '1' && s[i - 1] == '0') || (s[i] == '0' && s[i - 1] == '1')) {
      ans.push_back(s[i]);
      ans.push_back(s[i - 1]);
      s.erase(s.begin() + i - 1, s.begin() + i + 1);
      i = 1;
    } else {
      i++;
    }
  }
  cout << ans.size();
  return 0;
}
