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