#include <bits/stdc++.h>
using namespace std;
int main(void) {
  char a[1000005];
  cin >> a;
  long long ans = 0;
  int i;
  for (i = strlen(a) - 1; i >= 0;) {
    if (a[i] == '0') {
      ans++;
      i--;
    } else if (i > 0) {
      int len = 0;
      while (a[i] == '1' && i >= 0) {
        i--;
        len++;
      }
      if (i > 0) {
        a[i] = '1';
        ans += len + 1;
      } else {
        ans += len + 1;
        break;
      }
    } else
      break;
  }
  cout << ans << endl;
}
