#include <bits/stdc++.h>
using namespace std;
int main() {
  string str = "1";
  cin >> str;
  int res = 0, s = ((int)(str).size()) - 1, c = 0;
  bool b = true;
  while (s != 0) {
    string a = "";
    b = true;
    if (str[s] == '0') {
      s--;
    } else {
      for (int i = s; i >= 0; i--) {
        if (str[i] == '1') {
          str[i] = '0';
        } else {
          str[i] = '1';
          b = false;
          break;
        }
      }
      if (b) str = '1' + str;
      c = 1;
    }
    res++;
  }
  if (c) res++;
  cout << res << endl;
  return 0;
}
