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>
long long mdd = 998244353;
long long fac[500005];
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  string s;
  cin >> s;
  s = "0" + s;
  stack<int> stk;
  int c[s.length()], d[s.length()];
  c[0] = -1;
  d[0] = -1;
  int mx = 0;
  for (int i = 1; i < s.length(); i++) {
    if (s[i] == '(') {
      stk.push(i);
      d[i] = -1;
      c[i] = -1;
    } else {
      if (stk.empty()) {
        c[i] = -1;
        d[i] = -1;
        continue;
      }
      d[i] = stk.top();
      stk.pop();
      if (c[d[i] - 1] == -1) {
        c[i] = d[i];
      } else {
        c[i] = c[d[i] - 1];
      }
      mx = max(mx, i - c[i] + 1);
    }
  }
  int cnt = 0;
  for (int i = 0; i < s.length(); i++) {
    if (c[i] != -1 && mx == (i - c[i] + 1)) cnt++;
  }
  cout << mx << " " << max(1, cnt) << endl;
  return 0;
}