Takahashi has an empty string S and a variable x whose initial value is 0.

Also, we have a string T consisting of `0` and `1`.

Now, Takahashi will do the operation with the following two steps |T| times.

* Insert a `0` or a `1` at any position of S of his choice.
* Then, increment x by the sum of the digits in the odd positions (first, third, fifth, ...) of S. For example, if S is `01101`, the digits in the odd positions are `0`, `1`, `1` from left to right, so x is incremented by 2.



Print the maximum possible final value of x in a sequence of operations such that S equals T in the end.

Constraints

* 1 \leq |T| \leq 2 \times 10^5
* T consists of `0` and `1`.

Input

Input is given from Standard Input in the following format:


T


Output

Print the maximum possible final value of x in a sequence of operations such that S equals T in the end.

Examples

Input

1101


Output

5


Input

0111101101


Output

26
#include <bits/stdc++.h>
#define endl "\n"
using namespace std;
typedef long long ll;
typedef vector<ll> vl;
typedef pair<ll, ll> PP;
#define rep(i, n) for(ll i = 0; i < ll(n); i++)
#define rrep(i, n) for(ll i = n - 1; i > -1; i--)
#define all(v) v.begin(), v.end()
#define pb push_back
#define fi first
#define se second
#define debug(V) rep(i, V.size()) cout << V[i] << " ";
const ll INF = 1LL << 61;
const ll MOD = 1000000007 /*998244353*/;
const ll MAX_N = 500010;
ll a, b, c, d, e, f, h, x, y, z, p, q, m, n, t, r, k, w, l, ans, i, j;
string S, T;
vl A, B, C, D(MAX_N, 1);
void solve() {
    n = S.length();
    rep(i, n) {
        if(S[i] == '0') {
            if(i % 2 == 0) {
                A.pb(i);
                B.pb(i * 2);
            } else {
                A.pb(i);
                C.pb(i * 2);
            }
        } else
            x++;
    }
    a = 0;
    b = A.size();
    rep(i, b) {
        if((A[i] + a) % 2 == 0) {
            if(a % 2 == 0) {
                ans += (n + 1) / 2 - (B.end() - lower_bound(all(B), 2 * A[i] - 1));
            } else {
                ans += (n + 1) / 2 - (C.end() - lower_bound(all(C), 2 * A[i] - 1));
            }
            D[i] = 1;
            a++;
            n--;
        }
    }

    /*debug(A);
    cout << endl;
    debug(B);
    cout << endl;
    debug(C);
    cout << endl;*/

    // cout << ans << " " << n << endl;

    if(n % 2 == 1)
        ans += (n + 1) * (n + 1) / 4;
    else
        ans += n * (n + 2) / 4;

    cout << ans << endl;
}
int main() {
    // cout<<fixed<<setprecision(15);
    cin.tie(0);
    ios::sync_with_stdio(false);
    cin >> S;
    solve();
}