#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  std::cin >> s;
  if (s == "1") {
    std::cout << 0 << std::endl;
    return 0;
  }
  int ans = 0;
  bool advance = false;
  reverse(s.begin(), s.end());
  for (int i = 0; i < s.length() - 1; i++) {
    if (not advance and s[i] == '1') {
      ans += 2;
      advance = true;
    } else if (not advance and s[i] == '0') {
      ans++;
    } else if (advance and s[i] == '1') {
      ans++;
    } else {
      ans += 2;
    }
  }
  std::cout << ans + advance << std::endl;
  return 0;
}
