#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  string s;
  cin >> s;
  reverse(s.begin(), s.end());
  int carry = 0;
  int ans = 0;
  for (size_t i = 0; i + 1 < s.size(); ++i) {
    if (carry != 0) {
      if (s[i] == '0') {
        s[i] = '1';
        carry = 0;
      } else {
        s[i] = '0';
      }
    }
    if (s[i] == '0') {
      ans += 1;
    } else {
      ans += 2;
      carry = 1;
    }
  }
  if (carry) {
    ans += 1;
  }
  cout << ans << endl;
}
