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