#include <bits/stdc++.h>
using namespace std;
long long P = 1e9 + 7;
long long P1 = 998244353;
const int sqr = 500;
const int arrn = 1e6 + 5;
const int arrn2 = 6e3 + 5;
void solve() {
  string in;
  cin >> in;
  int n = in.length();
  vector<vector<long long>> proc(n, vector<long long>(3, INT_MAX));
  for (int i = 0; i < n; i++) {
    if (i == 0) {
      proc[i][1] = 1;
      proc[i][2] = 2;
    } else {
      if (in[i] == '0') {
        proc[i][0] = min(proc[i - 1][0], min(proc[i - 1][1], proc[i - 1][2]));
        proc[i][1] = min(1 + proc[i - 1][1],
                         min(2 + proc[i - 1][2], 2 + proc[i - 1][0]));
        proc[i][2] = min(1 + proc[i - 1][2],
                         min(2 + proc[i - 1][1], 2 + proc[i - 1][0]));
      } else {
        proc[i][1] =
            1 + min(proc[i - 1][0], min(proc[i - 1][1], proc[i - 1][2]));
        proc[i][2] =
            min(2 + proc[i - 1][0], min(2 + proc[i - 1][1], proc[i - 1][2]));
      }
    }
  }
  cout << min(proc[n - 1][0], min(proc[n - 1][1], proc[n - 1][2]));
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  int T = 1;
  while (T--) {
    solve();
  }
  return 0;
}
