#include <bits/stdc++.h>
int main() {
  char inp[1000001];
  scanf("%s", inp);
  long long int n = strlen(inp) - 1, max;
  max = n;
  long long int x = 0, ex = 1, cnt = 0, curr;
  while (n > 0) {
    if (inp[n] == '0' || n > max) {
      n--;
    } else {
      curr = n - 1;
      inp[n] = '0';
      while (inp[curr] == '1' && curr > 0) {
        inp[curr] = '0';
        curr--;
        if (curr == 0) {
          break;
        }
      }
      if (curr == 0 && inp[0] == '1') {
        n++;
      } else {
        inp[curr] = '1';
      }
    }
    cnt++;
  }
  printf("%lld", cnt);
}
