#include typedef long long ll; typedef std::pair P; typedef std::priority_queue, std::greater

> PQ; int main() { std::string s; std::cin >> s; int n = s.length(); ll ans = 0; int count = 0; for (int i = n - 1; i >= 1; --i) { if (s[i] == '0') count++; else { if (s[i - 1] == '1') { ans += count; --i; } else { count = 0; } } } std::cout << ans << std::endl; }