#include <bits/stdc++.h>
using namespace std;
const long long OO = 1LL << 60;
long long mod = 1000000007;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  string a;
  int ans = 0;
  bool rem = 0;
  cin >> a;
  for (int i = a.length() - 1; i > 0; i--) {
    if (rem) {
      if (a[i] == '0')
        ans += 2;
      else
        ans++;
    } else {
      if (a[i] == '0')
        ans++;
      else {
        ans += 2;
        rem = true;
      }
    }
  }
  if (rem) {
    ans++;
  }
  cout << ans << '\n';
  return 0;
}
