#include <bits/stdc++.h>
using namespace std;
string s;
int main() {
  cin >> s;
  int ans = 0;
  int was = 0;
  for (int i = (int)(s).size() - 1; i >= 0; --i)
    if (s[i] == '0') {
      if (was)
        ans += 2;
      else
        ans++;
    } else if (s[i] == '1') {
      if (was)
        ans++;
      else {
        if (i) ans += 2;
        was = 1;
      }
    }
  cout << ans << endl;
}
