#ifdef LOCAL #include #else #pragma GCC optimize("O3") // #pragma target("arch=skylake-avx512") #include #define debug(...) ((void)0) #endif using namespace std; using ll = long long; using ld = long double; void solve(int) { string S; cin >> S; const int N = S.size(); ll ans = 0; ll cnt = 0; for (int i = N - 2; i >= 0; i--) { if (S[i] == '1' && S[i + 1] == '1') { cnt += 2; ans += ((N - cnt) - i); i--; } } cout << ans << endl; } int main() { ios::sync_with_stdio(false); cin.tie(nullptr); int t = 1; // cin >> t; for (int i = 1; i <= t; i++) { solve(i); } #ifdef LOCAL postprocess(); #endif }