#include using namespace std; void fast_io() { ios::sync_with_stdio(false); std::cin.tie(nullptr); } int main() { fast_io(); string s; cin >> s; int n = s.size(); int ans = 0; for (int i = 2; i < n; i++) { int j = i; while (j >= 2 && s.substr(j - 2, 3) == "110") { swap(s[j], s[j - 2]); j -= 2; ans++; } } cout << ans << endl; }