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>
int main() {
  char s[1000001];
  gets(s);
  int n = strlen(s);
  int a[n], b[n];
  int i, j;
  for (i = 0; i < n; i++) {
    a[i] = 0;
    b[i] = 0;
  }
  for (i = 0; i < n; i++) {
    while (s[i] == ')' && i < n) {
      i++;
    }
    int k = 0;
    for (j = i; j < n; j++) {
      if (s[j] == '(')
        k++;
      else
        k--;
      if (k < 0) {
        i = j;
        break;
      }
      a[i]++;
      if (k == 0) b[i] = a[i];
      if (j == n - 1) {
        if (k > 0) {
          a[i] = 0;
          for (int x = n - 1; x >= i; x--) {
            while (s[x] == '(') {
              x--;
            }
            int z = 0;
            for (int y = x; y >= i; y--) {
              if (s[y] == ')')
                z++;
              else
                z--;
              if (z < 0) {
                x = y;
                break;
              }
              a[x]++;
              if (z == 0) b[x] = a[x];
            }
          }
          i = n;
        } else
          i = n;
      }
    }
  }
  int max = 0;
  int dem = 0;
  for (i = 0; i < n; i++) {
    if (max < b[i]) max = b[i];
  }
  if (max == 0)
    printf("0 1");
  else {
    for (i = 0; i < n; i++) {
      if (max == b[i]) dem++;
    }
    printf("%d %d", max, dem);
  }
  return 0;
}