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 CPP):

Solution:
#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
int main() {
  char s[1000001], ss[1000001];
  scanf("%s", s + 1);
  int l = strlen(s + 1), sum = 0, ans = 0, cur = 0, q = 0, summ = 0, anss = 0;
  for (register int i = 1; i <= l; i++) {
    if (s[i] == '(') {
      q++;
      cur++;
    } else if (q == 0)
      cur = 0;
    else {
      q--;
      if (q == 0) {
        if (cur == ans)
          sum++;
        else if (cur > ans) {
          ans = cur;
          sum = 1;
        }
      }
    }
  }
  q = l;
  for (register int i = 1; i <= l; i++)
    if (s[i] == '(')
      ss[q--] = ')';
    else
      ss[q--] = '(';
  cur = 0;
  for (register int i = 1; i <= l; i++) {
    if (ss[i] == '(') {
      q++;
      cur++;
    } else if (q == 0)
      cur = 0;
    else {
      q--;
      if (q == 0) {
        if (cur == anss)
          summ++;
        else if (cur > anss) {
          anss = cur;
          summ = 1;
        }
      }
    }
  }
  if (anss > ans) {
    ans = anss;
    sum = summ;
  }
  if (ans)
    printf("%d %d", ans << 1, sum);
  else
    printf("0 1");
  return 0;
}