#include <bits/stdc++.h>
using namespace std;
char s[1000001];
int main() {
  int a = 0, b = 1;
  scanf("%s", s);
  for (int i = 0; s[i]; i++) {
    if (s[i] == '1')
      a = min(a, b) + 1;
    else
      b = min(a, b) + 1;
  }
  b = min(a, b) + 1;
  printf("%d\n", min(a, b));
  return 0;
}
