#include <bits/stdc++.h>
int main(void) {
  char s[50];
  int m = 0, n = 0, j, i, k = 0;
  scanf("%s", &s);
  for (j = 0; s[j] != '\0'; j++) {
    k++;
  }
  for (i = 0; i <= k; i++) {
    if ((s[i] == '1') && (n == 0)) {
      n = 1;
      m++;
    } else if ((s[i] = '0') && (n == 1)) {
      n = 0;
      m++;
    }
  }
  if (m == 0)
    printf("0\n");
  else
    printf("%d\n", m + 2);
  return 0;
}
