#include <bits/stdc++.h>
using namespace std;
const int N = 1000005;
int n;
char str[N];
int dp[N][2];
int solve(int i, bool isFliped) {
  if (i == n) return isFliped ? 1e9 : 0;
  int &ret = dp[i][isFliped];
  if (ret != -1) return ret;
  if (str[i] == '1') {
    if (isFliped)
      ret = min(solve(i + 1, true), solve(i + 1, false) + 1);
    else
      ret = 1 + min(solve(i + 1, false), solve(i + 1, true));
  } else {
    if (isFliped)
      ret = 1 + min(solve(i + 1, true), solve(i + 1, false));
    else
      ret = min(solve(i + 1, false), solve(i + 1, true) + 1);
  }
  return ret;
}
int main() {
  scanf("%s", str);
  n = int(strlen(str));
  memset(dp, -1, sizeof dp);
  printf("%d", min(solve(0, 0), 1 + solve(0, 1)));
}
