#include <bits/stdc++.h>
using namespace std;
char a[1000006];
int dp[1000006][2];
int n;
int go(int pos, bool b) {
  int &ret = dp[pos][b];
  if (ret != -1) return ret;
  if (pos == n) return ret = 0;
  int val, v1, v2;
  if (b) {
    if (a[pos] == '1') {
      ret = go(pos + 1, 1);
    } else {
      v1 = go(pos + 1, 1) + 1;
      v2 = go(pos + 1, 0);
      ret = ((v1) < (v2) ? (v1) : (v2));
    }
  } else {
    if (a[pos] == '0') {
      ret = go(pos + 1, 0);
    } else {
      v1 = go(pos + 1, 0) + 1;
      v2 = go(pos + 1, 1) + 2;
      ret = ((v1) < (v2) ? (v1) : (v2));
    }
  }
  return ret;
}
int main() {
  cin >> a;
  n = strlen(a);
  memset((dp), (-1), sizeof(dp));
  go(0, 0);
  cout << dp[0][0] << endl;
  return 0;
}
