#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  bool flag = false;
  for (int i = s.size() - 1; i >= 1; i--) {
    if (s[i] == '1') {
      flag = true;
      break;
    }
  }
  if (s == "1")
    cout << 0 << "\n";
  else if (flag == false) {
    cout << s.size() - 1 << "\n";
  } else {
    int cnt = 0;
    int i;
    for (i = s.size() - 1; i >= 0; i--) {
      if (s[i] == '1') break;
    }
    for (int j = i; j >= 0; j--) {
      if (s[j] == '0') cnt++;
    }
    cnt++;
    cout << s.size() + cnt << "\n";
  }
  return 0;
}
