#include <bits/stdc++.h>
using namespace std;
char s[1000001];
int n, m;
void solve() {
  int i, len, dem;
  len = strlen(s);
  dem = 0;
  for (i = len - 1; i > 0; i--) {
    if (s[i] == '1') break;
  }
  if (i == 0) {
    cout << len - 1 << endl;
    return;
  }
  dem = 0;
  while (i-- > 0) {
    if (s[i] == '0') dem++;
  }
  cout << dem + len + 1 << endl;
}
void input() {
  int i, j, x, y;
  while (cin >> s) {
    solve();
  }
}
int main() {
  input();
  return 0;
}
