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.BufferedOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Random;

public class Solution {

    private static final long MOD = 1_000_000_007;

    public static void main(String[] args) {
        try (PrintWriter out = new PrintWriter(new BufferedOutputStream(System.out))) {
            _Scanner sc = new _Scanner(System.in);

            // 21:31-(21:50)-

            String s = sc.next();

            long[][] dp = new long[4][s.length() + 1];
            long even = 0, odd = 0;

            int end = 0;
            for (int i = 1; i <= s.length(); i++) {
                int len = i - end;
                boolean isEven = len % 2 == 0;
                if (i == s.length() || s.charAt(i) != s.charAt(i - 1)) {
                    end = i;
                }
                even += len / 2;
                odd += (len + 1) / 2;

                dp[0][i] = dp[0][i - 1];
                dp[1][i] = dp[1][i - 1];
                dp[2][i] = dp[2][i - 1];
                dp[3][i] = dp[3][i - 1];

                if (isEven) {
                    even += dp[0][i - 1];
                    odd += dp[1][i - 1];
                    if (i == end) {
                        dp[2][i] = dp[0][i - 1] + len / 2;
                        dp[3][i] = dp[1][i - 1] + (len + 1) / 2;
                        dp[0][i] = dp[2][i - 1];
                        dp[1][i] = dp[3][i - 1];
                    }
                } else {
                    even += dp[1][i - 1];
                    odd += dp[0][i - 1];
                    if (i == end) {
                        dp[2][i] = dp[1][i - 1] + len / 2;
                        dp[3][i] = dp[0][i - 1] + (len + 1) / 2;
                        dp[0][i] = dp[3][i - 1];
                        dp[1][i] = dp[2][i - 1];
                    }
                }
            }

            out.println(String.format("%s %s", even, odd));
        }
    }

    

    

    private static void reverse(int[] vs) {
        for (int i = 0; i < vs.length / 2; i++) {
            swap(vs, i, vs.length - 1 - i);
        }
    }

    static class _Scanner {
        InputStream is;

        _Scanner(InputStream is) {
            this.is = is;
        }

        byte[] bb = new byte[1 << 15];
        int k, l;

        byte getc() {
            try {
                if (k >= l) {
                    k = 0;
                    l = is.read(bb);
                    if (l < 0) return -1;
                }
                return bb[k++];
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }

        byte skip() {
            byte b;
            while ((b = getc()) <= 32)
                ;
            return b;
        }

        int nextInt() {
            int n = 0;
            int sig = 1;
            for (byte b = skip(); b > 32; b = getc()) {
                if (b == '-') {
                    sig = -1;
                } else {
                    n = n * 10 + b - '0';
                }
            }
            return sig * n;
        }

        long nextLong() {
            long n = 0;
            long sig = 1;
            for (byte b = skip(); b > 32; b = getc()) {
                if (b == '-') {
                    sig = -1;
                } else {
                    n = n * 10 + b - '0';
                }
            }
            return sig * n;
        }

        double nextDouble() {
            return Double.parseDouble(next());
        }

        public String next() {
            StringBuilder sb = new StringBuilder();
            for (int b = skip(); b > 32; b = getc()) {
                sb.append(((char) b));
            }
            return sb.toString();
        }
    }

    private static void shuffle(int[] ar) {
        Random rnd = new Random();
        shuffle(ar, rnd);
    }
    
    private static void shuffle(long[] ar) {
        Random rnd = new Random();
        shuffle(ar, rnd);
    }

    private static void shuffle(int[] ar, Random rnd) {
        for (int i = 0; i < ar.length; i++) {
            int j = i + rnd.nextInt(ar.length - i);
            swap(ar, i, j);
        }
    }
    
    private static void shuffle(long[] ar, Random rnd) {
        for (int i = 0; i < ar.length; i++) {
            int j = i + rnd.nextInt(ar.length - i);
            swap(ar, i, j);
        }
    }

    private static void shuffle(Object[] ar) {
        Random rnd = new Random();
        for (int i = 0; i < ar.length; i++) {
            int j = i + rnd.nextInt(ar.length - i);
            swap(ar, i, j);
        }
    }

    private static void swap(int[] ar, int i, int j) {
        int t = ar[i];
        ar[i] = ar[j];
        ar[j] = t;
    }

    private static void swap(long[] ar, int i, int j) {
        long t = ar[i];
        ar[i] = ar[j];
        ar[j] = t;
    }

    private static void swap(Object[] ar, int i, int j) {
        Object t = ar[i];
        ar[i] = ar[j];
        ar[j] = t;
    }

}