#include <bits/stdc++.h>
using namespace std;
int main(int argc, char *argv[]) {
  string s;
  cin >> s;
  int pointer = s.size() - 1;
  int c = 0;
  while (s[0] != '1' || pointer != 0) {
    if (s[pointer] == '0') {
      int i = pointer;
      for (i; i >= 0; i--) {
        if (s[i] == '1') break;
        pointer--;
        c++;
      }
    } else {
      c++;
      bool ch = 0;
      int i = pointer;
      for (i; i >= 0; i--) {
        if (s[i] == '0') {
          s[i] = '1';
          ch = 1;
          break;
        }
        s[i] = '0';
      }
      if (ch == 0) {
        s.insert(0, 1, '1');
        pointer++;
      }
    }
  }
  cout << c;
  return 0;
}
