Problem: 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:

  1. the number of good substrings of even length; 
  2. the number of good substrings of odd length. 

Input

The first line of the input contains a single string of length n (1 ≤ n ≤ 105). 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 = s1s2... sn is string slsl + 1... sr.

A string s = s1s2... sn is a palindrome if it is equal to string snsn - 1... s1.

Solution (in JAVA):

Solution:
import java.io.DataInputStream;
import java.io.PrintWriter;
import java.io.FileInputStream;
import java.io.IOException;

public class Goodsubstring
{
	static class Reader
	{
		final private int BUFFER_SIZE = 1 << 16;
		private DataInputStream din;
		private byte[] buffer;
		private int bufferPointer, bytesRead;

		public Reader()
		{
			din = new DataInputStream(System.in);
			buffer = new byte[BUFFER_SIZE];
			bufferPointer = bytesRead = 0;
		}

		public Reader(String file_name) throws IOException
		{
			din = new DataInputStream(new FileInputStream(file_name));
			buffer = new byte[BUFFER_SIZE];
			bufferPointer = bytesRead = 0;
		}

		public String readLine() throws IOException
		{
			byte[] buf = new byte[100001]; // line length
			int cnt = 0, c;
			while ((c = read()) != -1)
			{
				if (c == '\n')
					break;
				buf[cnt++] = (byte) c;
			}
			return new String(buf, 0, cnt);
		}

		public int nextInt() throws IOException
		{
			int ret = 0;
			byte c = read();
			while (c <= ' ')
				c = read();
			boolean neg = (c == '-');
			if (neg)
				c = read();
			do
			{
				ret = ret * 10 + c - '0';
			} while ((c = read()) >= '0' && c <= '9');

			if (neg)
				return -ret;
			return ret;
		}

		public long nextLong() throws IOException
		{
			long ret = 0;
			byte c = read();
			while (c <= ' ')
				c = read();
			boolean neg = (c == '-');
			if (neg)
				c = read();
			do {
				ret = ret * 10 + c - '0';
			}
			while ((c = read()) >= '0' && c <= '9');
			if (neg)
				return -ret;
			return ret;
		}

		public double nextDouble() throws IOException
		{
			double ret = 0, div = 1;
			byte c = read();
			while (c <= ' ')
				c = read();
			boolean neg = (c == '-');
			if (neg)
				c = read();

			do {
				ret = ret * 10 + c - '0';
			}
			while ((c = read()) >= '0' && c <= '9');

			if (c == '.')
			{
				while ((c = read()) >= '0' && c <= '9')
				{
					ret += (c - '0') / (div *= 10);
				}
			}

			if (neg)
				return -ret;
			return ret;
		}

		private void fillBuffer() throws IOException
		{
			bytesRead = din.read(buffer, bufferPointer = 0, BUFFER_SIZE);
			if (bytesRead == -1)
				buffer[0] = -1;
		}

		private byte read() throws IOException
		{
			if (bufferPointer == bytesRead)
				fillBuffer();
			return buffer[bufferPointer++];
		}

		public void close() throws IOException
		{
			if (din == null)
				return;
			din.close();
		}
	}
        static long a[],ae=0,ao=0;
        static void f(int s,int ed){
         long sum=0;int seo[][]=new int[2][2];
         for(int i=s;i<=ed;i+=2){
                 if(i==s){
                 for(int j=i+2;j<=ed;j+=2){
                  sum+=a[j-1];
                  if(sum%2==0){
                   seo[0][0]+=a[j]/2;seo[0][1]+=(a[j]+1)/2;
                  }else{
                   seo[1][0]+=a[j]/2;seo[1][1]+=(a[j]+1)/2;
                  }sum+=a[j];
                 }
                }
                 else{
                  if(a[i-1]%2==0){
                   seo[0][0]-=a[i]/2;seo[0][1]-=(a[i]+1)/2;
                  }else{
                   seo[1][0]-=a[i]/2;seo[1][1]-=(a[i]+1)/2;
                  }
                  if((a[i-1]+a[i])%2!=0){
                   seo[0][0]^=seo[1][0];seo[1][0]^=seo[0][0];seo[0][0]^=seo[1][0];
                   seo[0][1]^=seo[1][1];seo[1][1]^=seo[0][1];seo[0][1]^=seo[1][1];
                  }
                 }
                 long o=(a[i]+1)/2,e=a[i]/2;
                 ae+=o*seo[0][1]+e*seo[0][0]+o*seo[1][0]+e*seo[1][1];
                 ao+=o*seo[0][0]+e*seo[0][1]+o*seo[1][1]+e*seo[1][0];
        }
}  
        public static void main(String[] args) throws IOException
	{
		Reader s=new Reader();PrintWriter pw=new PrintWriter(System.out);
                String st=s.readLine().trim();int l=st.length();
                a=new long[l];int id=0;
                long cnt=1;char p=st.charAt(0);
                for(int i=1;i<l;i++){
                 char c=st.charAt(i);
                 if(c!=p){a[id]=cnt;cnt=1;id++;p=c;}
                 else cnt++;
                }a[id]=cnt;
                for(int j=0;j<=id;j++){
                 long a1o=0;
                 for(int i=1;i<=a[j];i++)a1o+=(i+1)/2;
                 ae+=a[j]*(a[j]+1)/2-a1o;ao+=a1o;
                }//System.out.println(ae+" "+ao);
                f(0,id);f(1,id);
                pw.write(ae+" "+ao);
		pw.flush();pw.close();
	}
}