#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  long long coun = 0;
  long long len = s.length();
  while (1) {
    if (len == 1) break;
    if (s[len - 1] == '1') {
      s[len - 1] = '0';
      int pos = -1;
      for (int i = len - 2; i >= 0; i--) {
        if (s[i] == '0') {
          s[i] = '1';
          pos = i;
          break;
        } else
          s[i] = '0';
      }
      if (pos == -1) {
        s = '1' + s;
        len = len + 1;
      }
    } else {
      len = len - 1;
    }
    coun++;
  }
  cout << coun << endl;
  return 0;
}
