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 long long LL;
typedef double DB;

const int maxn = (int)2e5 + 3;
int n;
char buf[maxn];
struct Segment {
	int cnt, val[2];
	void merge(Segment const &lft, Segment const &rht) {
		cnt = lft.cnt + rht.cnt;
		val[0] = lft.val[0] + rht.val[lft.cnt & 1];
		val[1] = lft.val[1] + rht.val[!(lft.cnt & 1)];
	}
} seg[maxn << 1 | 1];

inline int seg_idx(int L, int R) {
	return (L + R) | (L < R);
}
int seg_init(int L, int R) {
	int rt = seg_idx(L, R);
	if(L < R) {
		int M = (L + R) >> 1;
		int lch = seg_init(L, M);
		int rch = seg_init(M + 1, R);
		seg[rt].merge(seg[lch], seg[rch]);
	} else {
		seg[rt] = (Segment){0, 0, 0};
	}
	return rt;
}
int seg_upd(int L, int R, int x, int v) {
	int rt = seg_idx(L, R);
	if(x < L || x > R)
		return rt;
	if(L == R) {
		seg[rt] = (Segment){1, v, 0};
	} else {
		int M = (L + R) >> 1;
		int lch = seg_upd(L, M, x, v);
		int rch = seg_upd(M + 1, R, x, v);
		seg[rt].merge(seg[lch], seg[rch]);
	}
	return rt;
}

int main() {
	scanf("%s", buf);
	n = strlen(buf);
	int rt = seg_init(0, n - 1);
	LL ans = 0;
	for(int i = 0; i < n; ++i)
		if(buf[i] == '1') {
			seg_upd(0, n - 1, i, 1);
			ans += seg[rt].val[0];
		}
	int odd = 0;
	for(int i = 0; i < n; ++i)
		if(buf[i] == '1') {
			odd ^= 1;
		} else if(odd) {
			seg_upd(0, n - 1, i, 0);
			ans += seg[rt].val[0];
			buf[i] = '.';
			odd = 0;
		}
	for(int i = n - 1; i >= 0; --i)
		if(buf[i] == '0') {
			seg_upd(0, n - 1, i, 0);
			ans += seg[rt].val[0];
		}
	printf("%lld\n", ans);
	return 0;
}