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 double pi = acos(-1.0);
const int maxInt = 0x7fffffff;
const int minInt = ~maxInt;
const int N = 1000005;
char str[N];
int d[N], a[N];
int main() {
  int i, j, k, t, nc = 0;
  scanf("%s", str);
  int n = strlen(str);
  int sum = 0, cnt = 0;
  memset(d, 0, sizeof(d));
  memset(a, 0, sizeof(a));
  int tmax = 0;
  for (i = 0; i < n; i++) {
    if (str[i] == ')') {
      sum--;
      if (sum == 0) {
        d[i] = cnt;
        if (d[i - cnt * 2] != 0) {
          d[i] += d[i - cnt * 2];
          d[i - cnt * 2] = 0;
        }
        cnt = 0;
      } else if (sum < 0) {
        cnt = 0;
        sum = 0;
      }
    } else {
      cnt++;
      sum++;
    }
  }
  sum = 0, cnt = 0;
  for (i = n - 1; i >= 0; i--) {
    if (str[i] == '(') {
      sum--;
      if (sum == 0) {
        a[i] = cnt;
        if (a[i + cnt * 2] != 0) {
          a[i] += a[i + cnt * 2];
          a[i + cnt * 2] = 0;
        }
        cnt = 0;
      } else if (sum < 0) {
        cnt = 0;
        sum = 0;
      }
    } else {
      cnt++;
      sum++;
    }
  }
  for (i = 0; i < n; i++) {
    if (tmax < d[i]) {
      tmax = d[i];
    }
    tmax = max(tmax, a[i]);
  }
  int ans = 0;
  for (i = 0; i < n; i++) {
    if (d[i] == tmax) ans++;
  }
  for (i = 0; i < n; i++) {
    if (a[i] == tmax && d[i + tmax * 2 - 1] != tmax) {
      ans++;
    }
  }
  if (tmax == 0)
    printf("0 1\n");
  else
    printf("%d %d\n", tmax * 2, ans);
  return 0;
}