#include int main() { std::string s; std::cin >> s; std::reverse(s.begin(), s.end()); int res = 0; for (int i = 0; i < (int) s.size(); i++) { if (s[i] == '1') { res++; if (i + 1 < (int) s.size() && s[i + 1] == '1') { while(i < (int) s.size() && s[i] == '1') i++; if (i >= (int) s.size()) s.push_back('1'); else s[i] = '1'; i--; } } } std::cout << res << std::endl; return 0; }