#include <bits/stdc++.h>
using namespace std;
const int N = 1000001, oo = 1 << 29;
const long long ooo = 1ll << 59;
const long long ADD = 1e9;
char str[N];
int ans = 0;
int main() {
  cin >> str;
  int len = strlen(str);
  for (int i = len - 1; i >= 0; --i) {
    if (str[i] == '0')
      ++ans;
    else if (i != 0) {
      int &j = i, x = 0;
      while (j >= 0 && str[j] == '1') {
        ++x, --j;
      }
      ++x;
      ans += x;
      x = 0;
      while (j >= 0 && str[j] == '0') {
        ++x;
        --j;
      }
      ++j;
      --x;
      x = max(0, x);
      ans += (x * 2);
      if (j <= 0) break;
      str[j] = '1';
      ++j;
    }
  }
  cout << ans << endl;
  return 0;
}
