We call a string good, if after merging all the consecutive equal characters, the resulting string is palindrome. For example, "aabba" is good, because after the merging step it will become "aba".

Given a string, you have to find two values:  the number of good substrings of even length;  the number of good substrings of odd length. 


-----Input-----

The first line of the input contains a single string of length n (1 ≤ n ≤ 10^5). Each character of the string will be either 'a' or 'b'.


-----Output-----

Print two space-separated integers: the number of good substrings of even length and the number of good substrings of odd length.


-----Examples-----
Input
bb

Output
1 2

Input
baab

Output
2 4

Input
babb

Output
2 5

Input
babaa

Output
2 7



-----Note-----

In example 1, there are three good substrings ("b", "b", and "bb"). One of them has even length and two of them have odd length.

In example 2, there are six good substrings (i.e. "b", "a", "a", "b", "aa", "baab"). Two of them have even length and four of them have odd length.

In example 3, there are seven good substrings (i.e. "b", "a", "b", "b", "bb", "bab", "babb"). Two of them have even length and five of them have odd length.

Definitions

A substring s[l, r] (1 ≤ l ≤ r ≤ n) of string s = s_1s_2... s_{n} is string s_{l}s_{l} + 1... s_{r}.

A string s = s_1s_2... s_{n} is a palindrome if it is equal to string s_{n}s_{n} - 1... s_1.

Difficulty: interview

Starter code:

Solutions:
string=input()
length=len(string)
goodbad=[[1, 0, 0, 0] for x in range(length)]

#good odd
#bad odd
#good even
#bad even

for i in range(length-1):
    if string[i]==string[i+1]:
        goodbad[i+1][0]+=goodbad[i][2]
        goodbad[i+1][2]+=goodbad[i][0]
        goodbad[i+1][1]+=goodbad[i][3]
        goodbad[i+1][3]+=goodbad[i][1]
    else:
        goodbad[i+1][3]+=goodbad[i][0]
        goodbad[i+1][0]+=goodbad[i][3]
        goodbad[i+1][1]+=goodbad[i][2]
        goodbad[i+1][2]+=goodbad[i][1]

oddct=0
evenct=0
for i in range(len(goodbad)):
    oddct+=goodbad[i][0]
    evenct+=goodbad[i][2]
print(evenct, oddct)


s = input()
a = []
for c in s:
    a.append(ord(c) - ord('a'))
cnt = [[0, 0], [0, 0]]
ans = [0, 0]
for i in range(len(a)):
    cnt[a[i]][i % 2] += 1
    ans[0] += cnt[a[i]][i % 2]
    ans[1] += cnt[a[i]][1 - i % 2]
print(ans[1], ans[0])

t = input()
n = len(t)
t = [-1] + [i for i in range(n - 1) if t[i] != t[i + 1]] + [n - 1]
n = len(t) - 1
u, v = [0] * n, [0] * n
for i in range(n):
    d = t[i + 1] - t[i]
    k = d // 2
    u[i] = v[i] = k
    if d & 1:
        if t[i] & 1: v[i] += 1
        else: u[i] += 1
    i += 1
a = sum(u[i] for i in range(0, n, 2))
b = sum(v[i] for i in range(0, n, 2))
c = sum(u[i] for i in range(1, n, 2))
d = sum(v[i] for i in range(1, n, 2))
print(a * b + c * d, (a * (a + 1) + b * (b + 1) + c * (c + 1) + d * (d + 1)) // 2)

cnt = [[0 for col in range(2)] for row in range(2)]
ans = [0 for col in range(2)]
strx = input()
length = len(strx)
for i in range(length):
    if(strx[i]=='a'):
        cnt[0][i & 1]=cnt[0][i & 1]+1
        ans[0]+=cnt[0][i & 1 ^ 1]
        ans[1]+=cnt[0][i & 1]
    else:
        cnt[1][i & 1]=cnt[1][i & 1]+1
        ans[0]+=cnt[1][i & 1 ^ 1]
        ans[1]+=cnt[1][i & 1]
print(ans[0],ans[1])


s = input()
odd = 0
even = 0
cntE = [0, 0]
cntO = [0, 0]
for i in range(len(s)):
    cur = 0 + int(s[i] == 'b')
    odd += 1
    if i % 2 == 0:
        odd += cntE[cur]
        even += cntO[cur]
        cntE[cur] += 1
    else:
        odd += cntO[cur]
        even += cntE[cur]
        cntO[cur] += 1
print(even, odd)

def main():
    s = input()

    a = [0, 0]
    b = [0, 0]
    res = [0, 0]
    for i, c in enumerate(s, 1):
        ii, ij = i%2, (i+1)%2
        _a = a if c == 'a' else b
        res[1] += _a[ii] + 1
        res[0] += _a[ij]
        _a[ii] += 1

    print(*res)


def __starting_point():
    main()


__starting_point()

s = input()
d = {'a': [0, 0], 'b': [0, 0]}
odd = even = 0
for i in range(len(s)):
    d[s[i]][i & 1] += 1
    odd += d[s[i]][i & 1]
    even += d[s[i]][1 - i & 1]
print(even, odd)


s = input()
ep, op, enp, onp = 0, 0, 0, 0
prev = ''
totalE, totalO = 0, 0
for c in s:
	if prev == c:
		ep, op, enp, onp = op, ep + 1, onp, enp
	else:
		ep, op, enp, onp = onp, 1 + enp, op, ep
	# print(ep, op, enp, onp, c)
	totalO, totalE = totalO + op, totalE + ep
	prev = c
print(totalE, totalO)

s = input()
oddc = {'a':0,'b':0}
evenc = {'a':0,'b':0}
odd = 0
even = 0
for i in range(len(s)):
	odd+=1
	if i%2 == 0:
		even += oddc[s[i]]
		odd += evenc[s[i]]
		evenc[s[i]]+=1
	else:
		even += evenc[s[i]]
		odd += oddc[s[i]]
		oddc[s[i]]+=1
print(str(even) + " " + str(odd))

s = input()
m = [2*[0] for _ in range(2)] 
odd, even = 0, 0
for i in range(len(s)):
    m[1 if s[i] == 'a' else 0][i % 2] += 1
    odd += m[1 if s[i] == 'a' else 0][i % 2]
    even += m[1 if s[i] == 'a' else 0][not (i % 2)]

print(even, odd)


s = input()
odd = 0
even = 0
cntE = [0, 0]
cntO = [0, 0]
for i in range(len(s)):
    cur = 0 + int(s[i] == 'b')
    odd += 1
    if i % 2 == 0:
        odd += cntE[cur]
        even += cntO[cur]
        cntE[cur] += 1
    else:
        odd += cntO[cur]
        even += cntE[cur]
        cntO[cur] += 1
print(even, odd)

'''input
babaa
'''
from sys import stdin


# main starts
string = list(stdin.readline().strip())
odd_a = 0; even_a = 0; odd_b = 0; even_b = 0
even = 0
odd = 0

for i in string:
	if i == 'a':
		temp = odd_a
		odd_a = even_a + 1
		even_a = temp
		even_b, odd_b = odd_b, even_b
		odd += odd_a
		even += even_a
	else:
		temp = odd_b
		odd_b = even_b + 1
		even_b = temp
		even_a, odd_a = odd_a, even_a
		odd += odd_b
		even += even_b
print(even, odd)



s = input()

cntodda = 0
cntoddb = 0

cntevena =0
cntevenb = 0

evencnt = 0
oddcnt = 0

for i in range(len(s)):
    oddcnt += 1
    if i%2 == 0:
        if s[i]=='a':
            evencnt += cntodda
            oddcnt += cntevena
        else:
            evencnt += cntoddb
            oddcnt += cntevenb
        if s[i]=='a':
            cntevena+=1
        else:
            cntevenb+=1
    else:
        if s[i]=='a':
            evencnt += cntevena
            oddcnt += cntodda
        else:
            evencnt += cntevenb
            oddcnt += cntoddb
        if s[i]=='a':
            cntodda += 1
        else:
            cntoddb += 1
print(evencnt, oddcnt)


def R(): return map(int, input().split())
def I(): return int(input())
def S(): return str(input())

def L(): return list(R())

from collections import Counter 

import math
import sys

from itertools import permutations


import bisect

mod=10**9+7

#print(bisect.bisect_right([1,2,3],2))
#print(bisect.bisect_left([1,2,3],2))

s=S()
l=len(s)
A=[0]*2
B=[0]*2
for i in range(2):
    A[i]=[0]*(l+3)
    B[i]=[0]*(l+3)



for i in range(l):
    for j in range(2):
        if i%2!=j:
            A[j][i]=A[j][i-1]
            B[j][i]=B[j][i-1]
        else:
            A[j][i]=A[j][i-2]+(s[i]=='a')
            B[j][i]=B[j][i-2]+(s[i]=='b')

ans=[0]*2

for i in range(l):
    if s[i]=='a':
        ans[0]+=A[1-i%2][i]
        ans[1]+=A[i%2][i]
    else:
        ans[0]+=B[1-i%2][i]
        ans[1]+=B[i%2][i]

print(ans[0],ans[1])

import sys
import collections as cc
input=sys.stdin.readline
I=lambda:list(map(int,input().split()))
s=input().strip()
f=cc.defaultdict(list)
f['a']=[0,0]
f['b']=[0,0]
od=0
ev=0
for i in range(len(s)):
	if i%2==0:
		od+=f[s[i]][0]
		ev+=f[s[i]][1]
	else:
		od+=f[s[i]][1]
		ev+=f[s[i]][0]
	f[s[i]][i%2]+=1
print(ev,od+len(s))

s = input()

blocks = []

evenA = [0]
oddA = [0]
evenB = [0]
oddB = [0]

even = True

for x in s:
    evenA.append(evenA[-1])
    oddA.append(oddA[-1])
    evenB.append(evenB[-1])
    oddB.append(oddB[-1])
    if x == 'a':
        if even:
            evenA[-1] += 1
        else:
            oddA[-1] += 1
    else:
        if even:
            evenB[-1] += 1
        else:
            oddB[-1] += 1

    even = not even

even = True
totalE = 0
totalO = 0


for x in range(len(s)):
    if s[x] == 'a':
        if x%2 == 0:
            totalE += evenA[-1] - evenA[x]
            totalO += oddA[-1] - oddA[x]
        else:
            totalE += oddA[-1] - oddA[x]
            totalO += evenA[-1] - evenA[x]
    else:
        if x%2 == 0:
            totalE += evenB[-1] - evenB[x]
            totalO += oddB[-1] - oddB[x]
        else:
            totalE += oddB[-1] - oddB[x]
            totalO += evenB[-1] - evenB[x]

print(totalO,totalE)



#!/usr/bin/env python3
from sys import stdin


def solve():
    s = stdin.readline().strip()
    n = len(s)

    sfa = [[0, 0] for i in range(n+1)]
    sfb = [[0, 0] for i in range(n+1)]
    for i in range(n-1, -1, -1):
        sfa[i][:] = sfa[i+1][:]
        sfb[i][:] = sfb[i+1][:]
        if s[i] == 'a':
            sfa[i][i % 2] += 1
        else:
            sfb[i][i % 2] += 1

    ans = [0, 0]
    for i in range(n):
        if s[i] == 'a':
            ans[0] += sfa[i+1][i % 2]
            ans[1] += sfa[i+1][(i+1) % 2]
        else:
            ans[0] += sfb[i+1][i % 2]
            ans[1] += sfb[i+1][(i+1) % 2]

    print(ans[1], ans[0]+n)


solve()


s=input()
d=dict()
d['a']=[0,0]
d['b']=[0,0]
odd=even=0
for i  in range(len(s)):
  d[s[i]][i&1]+=1
  odd+=d[s[i]][i&1]
  even+=d[s[i]][1- i&1]

print(even,odd)