#include <bits/stdc++.h>
using namespace std;
char num[10000100];
int ans;
int main() {
  gets(num);
  int len = strlen(num);
  for (int i = len - 1; i >= 0; i--) {
    if (i == 0 && num[i] == '1') break;
    if (num[i] == '0') {
      ans++;
    } else if (num[i] == '1') {
      int j = i;
      ans++;
      while (num[j] == '1' && j >= 0) {
        num[j] = '0';
        j--;
      }
      if (j == 0) {
        num[0] = '1';
        for (int j = 1; j <= i; j++) {
          num[j] = '0';
        }
      } else
        num[j] = '1';
      i++;
    }
  }
  cout << ans << endl;
  return 0;
}
