#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  int count = 0;
  cin >> s;
  for (int i = 1; i < s.size(); i++) {
    for (int j = i - 1; j < i; j++) {
      if (s[i] == 0 && s[j] == 1) {
        s.erase(j, i);
        count++;
      }
      if (s[i] == 1 && s[j] == 0) {
        s.erase(j, i);
        count++;
      }
    }
  }
  cout << count;
  return 0;
}
