#include <bits/stdc++.h>
using namespace std;
const int nmax = 1e6 + 5;
int dp[nmax][2];
int main() {
  int n;
  string s;
  cin >> s;
  n = s.size();
  dp[0][0] = 0;
  dp[0][1] = 1;
  for (int i = 1; i <= n; ++i) {
    dp[i][0] = min(dp[i - 1][0] + (s[i - 1] == '1'),
                   dp[i - 1][1] + (s[i - 1] == '0') + 1);
    dp[i][1] = min(dp[i - 1][1] + (s[i - 1] == '0'),
                   dp[i - 1][0] + (s[i - 1] == '1') + 1);
  }
  cout << dp[n][0] << '\n';
}
