#include <bits/stdc++.h>
using namespace std;
int main() {
  char num[1000005];
  int i, ans = 0;
  scanf("%s", num);
  i = strlen(num) - 1;
  while (i != 0) {
    if (num[i] == '0') {
      ans++;
      for (; num[--i] == '0'; ans++) {
        ;
      }
    } else if (num[i] == '1') {
      ans++;
      while (i != 0 && num[i] == '1') {
        ans++;
        i--;
      }
      if (i == 0) {
        ans++;
      } else
        num[i] = '1';
    }
  }
  printf("%d\n", ans);
  return 0;
}
