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;
queue<int> q;
int main() {
  string str;
  cin >> str;
  int left[1000000], right[1000000];
  int n = (int)str.length();
  for (int i = 0; i < (int)(n); ++i) left[i] = -1;
  for (int i = 0; i < (int)(n); ++i) right[i] = -1;
  for (int i = 0; i < (int)(n - 1); ++i) {
    int j = i + 1;
    if (str[i] == '(' && str[j] == ')') {
      left[i] = j;
      right[j] = i;
      q.push(i);
    }
  }
  while (!q.empty()) {
    int t = q.front();
    q.pop();
    if (left[t] == -1) continue;
    int l = t - 1;
    int r = left[t] + 1;
    if (l >= 0 && r < n) {
      if (str[l] == '(' && str[r] == ')') {
        left[l] = r;
        left[t] = -1;
        right[r] = l;
        q.push(l);
        continue;
      }
    }
    if (l > 0 && right[l] != -1 && left[right[l]] != -1) {
      left[right[l]] = left[t];
      right[left[t]] = right[l];
      left[t] = -1;
      q.push(right[l]);
      continue;
    }
    if (r < n - 1 && left[r] != -1) {
      left[t] = left[r];
      right[left[r]] = t;
      left[r] = -1;
      q.push(t);
    }
  }
  int maxl = -1, count = 0;
  for (int i = 0; i < (int)(n); ++i) {
    if (left[i] == -1) continue;
    int len = left[i] - i + 1;
    if (len > maxl) {
      maxl = len;
      count = 0;
    }
    if (len == maxl) count++;
  }
  if (maxl == -1)
    cout << "0 1";
  else
    cout << maxl << ' ' << count;
  return 0;
}