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;
template<typename T1,typename T2> inline void chmin(T1 &a,T2 b){if(a>b) a=b;}
template<typename T1,typename T2> inline void chmax(T1 &a,T2 b){if(a<b) a=b;}
using Int = long long;
const char newl = '\n';

//INSERT ABOVE HERE
signed main(){
  cin.tie(0);
  ios::sync_with_stdio(0);

  string t;
  cin>>t;

  using P = pair<Int, Int>;
  vector<P> vp;
  vp.emplace_back(0,0);
  for(char c:t){
    Int k=c-'0';
    if(vp.back().first!=k)
      vp.emplace_back(k,0);
    vp.back().second++;
  }
  if(vp.back().first!=0)
    vp.emplace_back(0,0);

  Int cnt=0;
  for(char c:t)
    if(c=='1') cnt++;

  Int ans=0;
  for(Int i=0;i<cnt;i++)
    ans+=(i+1)/2;

  Int num=t.size()-cnt;
  Int tmp=0;
  Int add=1;
  for(auto p:vp){
    if(p.first==0){
      tmp+=p.second;
      continue;
    }
    if(p.first==1){
      ans+=(p.second/2)*num;
      if(p.second&1){
        ans+=(tmp+add)/2;
        ans+=(num-tmp);
        add^=1;
      }
    }
  }

  for(Int i=0;i<(Int)t.size();i++)
    if(~i&1) ans+=t[i]-'0';

  cout<<ans<<newl;
  return 0;
}
