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;
struct node {
  int lei, num;
};
int n;
string s;
int ans1 = 0, ans2 = 1, a[1000010];
vector<node> t;
int main() {
  cin >> s;
  n = s.size();
  node now;
  int end = -100, lon;
  for (int i = 0; i < n; i++) {
    if (s[i] == '(') now.lei = 0;
    if (s[i] == ')') now.lei = 1;
    now.num = i;
    if (t.empty()) {
      t.push_back(now);
      continue;
    }
    if (t[t.size() - 1].lei == 0 && now.lei == 1) {
      a[t[t.size() - 1].num + 1]++;
      a[i + 2]--;
      t.pop_back();
      continue;
    }
    t.push_back(now);
  }
  int len = 0, x = 0;
  for (int i = 1; i <= n + 1; i++) {
    x += a[i];
    if (x) len++;
    if (!x) {
      if (len == ans1) ans2++;
      if (len > ans1) ans1 = len, ans2 = 1;
      len = 0;
    }
  }
  if (ans1 == 0) ans2 = 1;
  cout << ans1 << ' ' << ans2;
  return 0;
}