#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  int i = s.size() - 1;
  int ans = 0;
  while (i >= 0) {
    if (s[i] == '0')
      ans++, i--;
    else {
      int j = i;
      if (j == 0 && s[j] == '1') break;
      while (s[j] != '0' && j >= 0) s[j] = '0', j--;
      if (j >= 0) s[j] = '1';
      ans++;
    }
  }
  cout << ans;
  return 0;
}
