#include <bits/stdc++.h>
using namespace std;
int f[2][1000111];
string s;
int main() {
  ios ::sync_with_stdio(false);
  while (cin >> s) {
    int n = s.length();
    for (int i = 0, _a = (n); i < _a; i++) {
      if (i == 0) {
        if (s[i] == '0') {
          f[0][i] = 0;
          f[1][i] = 0;
        } else {
          f[0][i] = 1;
          f[1][i] = 1;
        }
      } else {
        if (s[i] == '0') {
          f[0][i] = min(f[0][i - 1], f[1][i - 1] + 1);
          f[1][i] = min(f[0][i - 1] + 2, f[1][i - 1] + 1);
        } else {
          f[0][i] = min(f[0][i - 1] + 1, f[1][i - 1] + 2);
          f[1][i] = min(f[0][i - 1] + 1, f[1][i - 1]);
        }
      }
    }
    cout << min(f[0][n - 1], f[1][n - 1] + 1) << endl;
  }
  return 0;
}
