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;
int n, table[27][1000001], a[1000001], bal[1000001];
string s;
int get_bal(int l, int r) {
  if (!l) return bal[r];
  return bal[r] - bal[l - 1];
}
int get_min(int l, int r) {
  int len = log2(r - l + 1);
  return min(table[len][l], table[len][r - (1 << len) + 1]);
}
map<int, vector<int> > q;
map<int, int> sz;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cin >> s;
  n = (int)s.size();
  for (int i = 0; i < n; i++) {
    bal[i] = (s[i] == '(') ? 1 : -1;
    if (i) bal[i] += bal[i - 1];
    q[bal[i]].push_back(i);
  }
  for (int i = 0; i < 27; i++) {
    int len = (1 << i);
    for (int j = 0; j + len <= n; j++) {
      if (!i)
        table[i][j] = bal[j];
      else
        table[i][j] = min(table[i - 1][j], table[i - 1][j + len / 2]);
    }
  }
  int mx = 0;
  for (auto u : q) {
    vector<int> &v = u.second;
    if (!u.first)
      for (int i = 0; i < v.size(); i++) {
        if (!get_bal(0, v[i]) && get_min(0, v[i]) >= 0 && v[i] + 1 >= mx) {
          mx = v[i] + 1;
          sz[mx]++;
        }
      }
    for (int i = 0, j = 1; j < v.size() && i < v.size(); i++) {
      while (j < v.size() && v[j] - v[i] < mx) j++;
      if (j == v.size()) break;
      while (!get_bal(v[i] + 1, v[j]) && get_min(v[i] + 1, v[j]) >= bal[v[i]] &&
             v[j] - v[i] >= mx) {
        mx = v[j] - v[i];
        sz[mx]++;
        j++;
        if (j >= v.size()) break;
      }
    }
  }
  sz[0] = 1;
  cout << mx << " " << sz[mx];
}