#include <bits/stdc++.h>
using namespace std;
const int INF = (1 << 30) - 1;
const int DIRX[] = {-1, 0, 0, 1, -1, -1, 1, 1},
          DIRY[] = {0, -1, 1, 0, -1, 1, -1, 1};
const double ERR = 1e-9, PI = (2 * acos(0.0));
template <class T>
inline T MIN(T a, T b) {
  return ((a < b) ? (a) : (b));
}
template <class T>
inline T MAX(T a, T b) {
  return ((b < a) ? (a) : (b));
}
template <class T>
inline T ABS(T a) {
  return ((a < (T)0) ? (-a) : (a));
}
template <class T>
inline void checkMIN(T& a, T b) {
  if (b < a) a = b;
}
template <class T>
inline void checkMAX(T& a, T b) {
  if (a < b) a = b;
}
template <class T>
T SQR(T x) {
  return (x * x);
}
template <class T>
T GCD(T a, T b) {
  if (!b)
    return a;
  else
    return GCD(b, a % b);
}
template <class T>
T fastPow(T Base, T Power) {
  T Result = (T)1;
  while (Power > 0) {
    if (Power & (T)1) Result *= Base;
    Power >>= 1;
    Base *= Base;
  }
  return Result;
}
template <class T>
T modPow(T Base, T Power, T Mod) {
  T Result = (T)1;
  while (Power > 0) {
    if (Power & (T)1) Result = (Result * Base) % Mod;
    Power >>= 1;
    Base = (Base * Base) % Mod;
  }
  return (Result % Mod);
}
inline int CompareDouble(double x, double y, double err = ERR) {
  double d = x - y;
  if (d > err) return 1;
  if (d < -err) return -1;
  return 0;
}
int main() {
  int _kase = 1;
  int i, j, k, n, l, c;
  string s;
  long long r;
  while (_kase--) {
    cin >> s;
    l = ((int)(s).size()) - 1;
    c = 0;
    r = 0;
    for (; l > 0; l--) {
      if (s[l] == '1') {
        if (c == 1) {
          r++;
        } else {
          c = 1;
          r += 2;
        }
      } else {
        if (c == 1) {
          r += 2;
        } else {
          r++;
        }
      }
    }
    if (c > 0) {
      r++;
    }
    cout << r << endl;
  }
  return 0;
}
