#include <bits/stdc++.h>
using namespace std;
int chh;
const int N = 1000005, INF = ~0U >> 2;
string s;
int dp[N][2];
int main() {
  int sz;
  while (cin >> s) {
    memset(dp, 0x3f, sizeof(dp));
    s.reserve();
    if (s[0] == '0')
      dp[0][0] = 0, dp[0][1] = 2;
    else
      dp[0][0] = dp[0][1] = 1;
    sz = s.size();
    for (int i = (1); i <= (sz - 1); i++) {
      if (s[i] == '0') {
        dp[i][0] = min(dp[i - 1][0], dp[i - 1][1] + 1);
        dp[i][1] = min(dp[i - 1][0] + 2, dp[i - 1][1] + 1);
      } else {
        dp[i][0] = min(dp[i - 1][0] + 1, dp[i - 1][1] + 1);
        dp[i][1] = min(dp[i - 1][0] + 1, dp[i - 1][1]);
      }
    }
    printf("%d\n", min(dp[sz - 1][0], dp[sz - 1][1] + 1));
  }
  return 0;
}
