#include <bits/stdc++.h>
int main() {
  char x[1000002];
  scanf("%s", x);
  int n = strlen(x);
  int flag = 0;
  int counter = 0;
  for (int i = n - 1; i >= 0; i--) {
    if (i == 0 && flag == 0) {
      break;
    }
    if (x[i] == '0' && flag == 1) {
      x[i] = '1';
      flag = 0;
    }
    if (x[i] == '1' && flag == 0) {
      flag = 1;
      counter++;
    } else if (x[i] == '0') {
      flag = 0;
    }
    counter++;
  }
  printf("%d", counter);
  return 0;
}
