#include <bits/stdc++.h>
using namespace std;
char str[1000010];
int addone(char str[], int len) {
  int i = len - 1;
  while (1) {
    if (str[i] == '1') {
      str[i] = '0';
      i--;
      continue;
    } else {
      str[i] = '1';
      break;
    }
  }
  if (str[0] == '1')
    return 1;
  else
    return 0;
}
int main() {
  int i, j;
  while (scanf("%s", str) != EOF) {
    int count = 0;
    int len = strlen(str);
    for (i = len - 1; i >= 0; i--) str[i + 1] = str[i];
    str[0] = '0';
    len += 1;
    while (len - 1 != 1) {
      if (str[len - 1] == '1')
        len += addone(str, len);
      else
        len--;
      count++;
    }
    printf("%d\n", count);
  }
  return 0;
}
