#include <bits/stdc++.h>
using namespace std;
const int INF = (int)1e9 + 7;
int main() {
  string s;
  cin >> s;
  int n = s.length();
  if (n == 1) return !(cout << 1 << endl);
  reverse(begin(s), end(s));
  vector<vector<int>> dp(n + 2, vector<int>(2));
  dp[0][1] = INF;
  s += '0';
  for (int i = 0; i <= n; i++) {
    if (s[i] == '0') {
      dp[i + 1][0] = min(dp[i][0], dp[i][1] + 1);
      dp[i + 1][1] = dp[i][1] + 1;
    }
    if (s[i] == '1') {
      dp[i + 1][1] = min(dp[i][1], dp[i][0] + 1);
      dp[i + 1][0] = dp[i][0] + 1;
    }
  }
  cout << dp[n + 1][0] << endl;
  return 0;
}
