Problem: This is yet another problem dealing with regular bracket sequences.

We should remind you that a bracket sequence is called regular, if by inserting «+» and «1» into it we can get a correct mathematical expression. For example, sequences «(())()», «()» and «(()(()))» are regular, while «)(», «(()» and «(()))(» are not. 

You are given a string of «(» and «)» characters. You are to find its longest substring that is a regular bracket sequence. You are to find the number of such substrings as well.

Input

The first line of the input file contains a non-empty string, consisting of «(» and «)» characters. Its length does not exceed 106.

Output

Print the length of the longest substring that is a regular bracket sequence, and the number of such substrings. If there are no such substrings, write the only line containing "0 1".

Examples

Input

)((())))(()())


Output

6 2


Input

))(


Output

0 1

Solution (in JAVA):

Solution:

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.Stack;
import java.util.StringTokenizer;

public class Div3_724 {

	static class pair {
		long first;
		long second;

		public pair(long first, long second) {
			this.first = first;
			this.second = second;
		}

	}

	static void sort(int[] a) {
		ArrayList<Integer> l = new ArrayList<>();
		for (int i : a)
			l.add(i);
		Collections.sort(l);
		for (int i = 0; i < a.length; i++)
			a[i] = l.get(i);
	}

	static long power(int x, int y, int p) {
		if (y == 0)
			return 1;
		else if (y % 2 == 0) {
			long a = power(x, y / 2, p) % p;
			return (a * a) % p;
		}

		else {
			long a = power(x, y / 2, p) % p;
			return (x * (a * a) % p) % p;
		}

	}

	public static void main(String[] args) {
		FastReader sc = new FastReader();

		String str = sc.nextLine();
		int n = str.length();
		char[] ch = str.toCharArray();

		Stack<Integer> stk = new Stack<>();

		int[] s = new int[n];
		int[] e = new int[n];
		int[] f = new int[n + 1];

		Arrays.fill(s, -1);
		Arrays.fill(e, -1);

		for (int i = 0; i < n; i++) {
			if (ch[i] == '(') {
				stk.push(i);
			} else {
				if (stk.isEmpty() == false) {
					int j = stk.pop();
					s[i] = j;
					e[i] = j;

					if (j - 1 >= 0 && e[j - 1] != -1) {
						e[i] = e[j - 1];
					}

					f[i - e[i] + 1]++;

				}
			}
		}

		int c = 0;
		f[0] = 1;
		for (int i = n; i >= 0; i--) {
			if (f[i] > 0) {
				c = i;
				break;
			}
		}

		System.out.println(c + " " + f[c]);

	}

}

class multiset {
	final private HashMap<Integer, ArrayList<Integer>> mset = new HashMap<>();

	public void add(int value, int index) {
		if (mset.containsKey(value)) {
			mset.get(value).add(index);
		}
	}

	public int delete(int value) {
		if (mset.containsKey(value)) {
			ArrayList<Integer> arr = mset.get(value);
			int ret = arr.get(arr.size() - 1);
			arr.remove(arr.size() - 1);
			if (arr.size() == 0) {
				mset.remove(value);
			}
			return ret;
		} else {
			return -1;
		}
	}

	public boolean contains(int value) {
		return mset.containsKey(value);
	}
}

class FastReader {
	BufferedReader br;
	StringTokenizer st;

	public FastReader() {
		br = new BufferedReader(new InputStreamReader(System.in));
	}

	String next() {
		while (st == null || !st.hasMoreElements()) {
			try {
				st = new StringTokenizer(br.readLine());
			} catch (IOException e) {
				e.printStackTrace();
			}
		}
		return st.nextToken();
	}

	int nextInt() {
		return Integer.parseInt(next());
	}

	long nextLong() {
		return Long.parseLong(next());
	}

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

	int[] readArray(int n) {
		int[] a = new int[n];
		for (int i = 0; i < n; i++)
			a[i] = nextInt();
		return a;
	}

	String nextLine() {
		String str = "";
		try {
			str = br.readLine();
		} catch (IOException e) {
			e.printStackTrace();
		}
		return str;
	}
}