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>
using namespace std;
typedef vector<int> vi;
typedef vector<vector<int> > vvi;
typedef vector<pair<int, int> > vpii;
typedef pair<int, int> pii;
typedef long long ll;
typedef long double ld;
typedef pair<ll, ll> pll;
typedef pair<double, double> pdd;
typedef vector<ll> vll;
#define INF 0x3f3f3f3f
#define MOD 998244353LL
#define EPS 0.00001
#define f first
#define s second
#define pb push_back

#define FOR(i, a, b) for (int i=(a); i<=(signed)(b); i++)
#define F0R(i, a) for (int i=0; i<(signed)(a); i++)
#define RFOR(i, a, b) for (int i=(a); i >= b; i--)

#define MN 200005
int n;
string t;
int zc, oc;
int pz[MN];

int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(0);

    cin >> t;
    int n = t.length();
    F0R(i, n) if(t[i] == '0') ++zc; else ++oc;
    RFOR(i, n-1, 0) pz[i] = pz[i+1]+(t[i]=='0'?1:0);
    //111...1 ans = (n/2)+(n/2)+...
    ll ans = 0;
    FOR(i, 1, oc){
        ans += (i+1)/2;
    }

    int nz = 0;
    int cl = 0;
    int oc = 0;
    F0R(i, n){
        if(t[i] == '0'){
            if(cl % 2 == 1){
                //keep
                //cout << "keeping " << i << "\n";
                ++cl;
                ++nz;
            }
        } else{
            //always keep this guy!
            //process the deletions before this guy
            //moving from location i to location cl excl. count number of evens
            ans = ans+(i/2+1)-(cl/2+1);
            if(cl%2==0){
                //how long do i sit here?
                //however many zeroes are to the right of this guy
                //cout << "hi " << pz[i+1] << "\n";;
                ans += pz[i+1];
            }
            //now we move from this location to oc excl. how many evens
            ans = ans+(cl/2+1)-(oc/2+1);
            ++cl;
            ++oc;
        }
        //cout << i << " " << ans << "\n";
    }
    cout << ans << "\n";

    return 0;
}
