#include <bits/stdc++.h>
using namespace std;
const int maxn = 1000 * 1000 + 2;
const int inf = 1000 * 1000 * 1000 + 7;
string s;
int a[maxn];
int b[maxn];
int main() {
  for (int i = 0; i < maxn; i++) {
    a[i] = inf;
    b[i] = inf;
  }
  cin >> s;
  int sz = s.size();
  a[0] = 1;
  b[0] = 2;
  for (int i = 1; i < sz; i++) {
    if (s[i] - '0' == 1) {
      a[i] = min(b[i - 1] + 1, a[i - 1] + 1);
      b[i] = min(b[i - 1], a[i - 1] + 2);
    } else {
      a[i] = min(b[i - 1], a[i - 1]);
      b[i] = min(b[i - 1] + 1, a[i - 1] + 2);
    }
  }
  cout << min(a[sz - 1], b[sz - 1]);
  return 0;
}
