#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  long long int ans = 0, cnt = 0, k = s.size();
  char st = s[k - 1];
  for (int i = k - 1; i >= 0; i--) {
    if (st == s[i]) {
      cnt++;
    } else {
      if (st == '0') {
        ans += cnt;
        st = '1';
      } else {
        ans += cnt + 1;
        s[i] = '1';
        st = s[i];
      }
      cnt = 1;
    }
  }
  if (k > 1) {
    if (s[0] == s[1]) {
      ans += cnt + 1;
    }
  }
  cout << ans << endl;
}
