#include <bits/stdc++.h>
using namespace std;
void reader() {}
void IOFast() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
}
void solve() {
  string s;
  cin >> s;
  long long n = s.length();
  long long c = 0, index = -1;
  for (long long i = 0; i < n; i++)
    if (s[i] == '1') index = i;
  if (index == 0) {
    cout << n - 1 << endl;
    return;
  }
  for (long long i = 0; i < index; i++)
    if (s[i] == '0') c++;
  cout << c + n + 1;
  cout << "\n";
}
signed main() {
  reader();
  IOFast();
  long long t = 1;
  while (t--) solve();
  return 0;
}
