#include <bits/stdc++.h>
using namespace std;
const long long MAX_N = 1e5 + 10;
const long long INF = 1e9 + 10;
const long long mod = 1e18;
ofstream out("output.txt");
ifstream in("intput.txt");
long long bpow(long long t, long long n) {
  long long ans = 1;
  while (n > 0) {
    if (n & 1) ans = (ans * t) % mod;
    t = (t * t) % mod, n >>= 1;
  }
  return ans;
}
int32_t main() {
  ios::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  cout << fixed << setprecision(12);
  string s;
  long long n;
  cin >> s;
  n = s.length();
  long long st = 0, en = 0, k = 0;
  for (long long i = 1; i < n; i++)
    if (s[i] == '1')
      st = i, en = k;
    else
      k++;
  cout << n + en + (st > 0) * 2 - 1;
}
