#include <bits/stdc++.h>
using namespace std;
void logf(istream_iterator<string> it) {}
template <typename T, typename... Args>
void logf(istream_iterator<string> it, T a, Args... args) {
  cout << *it << "=" << a << " ";
  logf(++it, args...);
}
const double PI = acos(-1);
void solve() {
  string s;
  cin >> s;
  ;
  reverse(s.begin(), s.end());
  int ans = 0;
  int car = 0;
  function<void(int)> inc = [&](int idx) {
    if (idx == s.size())
      s += '1';
    else {
      if (s[idx] == '1') {
        s[idx] = '0';
        inc(idx + 1);
      } else
        s[idx] = '1';
    }
  };
  for (size_t i = 0; i + 1 < s.size(); i++) {
    if (s[i] == '1') {
      inc(i);
      ans++;
    }
    if (i + 1 < s.size()) ans++;
  }
  cout << ans << endl;
}
int main() {
  cin.tie(nullptr);
  std::ios::sync_with_stdio(false);
  solve();
}
