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