#include <bits/stdc++.h>
using namespace std;
const int N = 1000100;
int dp[N][2], n, a[N];
string s;
int f(int idx, bool goingOn) {
  if (idx == n) {
    return 0;
  }
  if (dp[idx][goingOn] != -1) {
    return dp[idx][goingOn];
  }
  int ans = 100000000;
  if (goingOn) {
    if (a[idx] == 1) {
      ans = min(ans, f(idx + 1, 1));
    } else {
      ans = min(ans, f(idx + 1, 1) + 1);
      ans = min(ans, f(idx + 1, 0));
    }
  } else {
    if (a[idx] == 1) {
      ans = min(ans, f(idx + 1, 1) + 2);
      ans = min(ans, f(idx + 1, 0) + 1);
    } else {
      ans = min(ans, f(idx + 1, 0));
    }
  }
  return dp[idx][goingOn] = ans;
}
int main() {
  ios::sync_with_stdio(false);
  cin >> s;
  n = s.size();
  for (int i = 0; i < n; i++) {
    a[i] = (s[i] == '1');
  }
  memset(dp, -1, sizeof dp);
  cout << f(0, 0) << "\n";
}
