#include <bits/stdc++.h>
using namespace std;
int main() {
  string bin;
  cin >> bin;
  int ans = 0;
  for (int i = bin.size() - 1; i >= 0; i--) {
    if (bin[i] == '0')
      ans++;
    else if (bin[i] == '1') {
      if (i == 0) break;
      ans += 2;
      bin[i - 1]++;
    } else {
      ans++;
      if (i != 0) bin[i - 1]++;
    }
  }
  cout << ans;
}
