#include <bits/stdc++.h>
using namespace std;
int ans;
int main() {
  string s;
  cin >> s;
  reverse((s).begin(), (s).end());
  int carry = 0;
  for (int i = 0; i < s.size() - 1; i++) {
    if (s[i] == '0' && !carry) {
      ans++;
      continue;
    }
    if (s[i] == '1' && !carry) {
      ans += 2;
      carry = 1;
      continue;
    }
    if (s[i] == '0' && carry) {
      ans += 2;
      continue;
    }
    if (s[i] == '1' && carry) {
      ans++;
      continue;
    }
  }
  if (carry) ans++;
  cout << ans;
}
