#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  string str;
  long long int i, cnt = 0, j;
  cin >> str;
  for (i = str.size() - 1; i >= 0; i--) {
    if (str[i] == '0')
      cnt++;
    else {
      cnt += 2;
      break;
    }
  }
  if (i == 0) {
    cout << cnt - 2 << endl;
    return 0;
  }
  for (j = i - 1; j >= 0; j--) {
    if (str[j] == '1')
      cnt++;
    else
      cnt += 2;
  }
  cout << cnt << endl;
  return 0;
}
