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;
bool cmp(pair<int, int> a, pair<int, int> b) { return a.first < b.first; }
int main() {
  int len, k;
  vector<pair<int, int> > R, P;
  map<int, int> F;
  stack<pair<char, int> > S;
  string str;
  cin >> str;
  len = str.length();
  for (int i = 0; i < (len); ++i) {
    if (str[i] == ')' && S.empty()) continue;
    if (str[i] == '(') {
      S.push(make_pair(str[i], i));
    } else {
      k = S.top().second;
      S.pop();
      R.push_back(make_pair(k, i));
    }
  }
  sort((R).begin(), (R).end(), cmp);
  int sz = R.size();
  for (int i = 0; i < (sz); ++i) {
    k = i;
    P.push_back(make_pair(R[i].first, R[i].second));
    while (i + 1 < sz && R[k].second >= R[i + 1].first) {
      ++i;
    }
  }
  sz = P.size();
  for (int i = 0; i < (sz); ++i) {
    len = P[i].second - P[i].first + 1;
    while (i < sz && P[i].second + 1 == P[i + 1].first) {
      ++i;
      len += P[i].second - P[i].first + 1;
    }
    ++F[len];
  }
  int best = 0;
  for (map<int, int>::iterator it = F.begin(); it != F.end(); ++it) {
    best = max(best, it->first);
  }
  if (best == 0) {
    cout << ("0 1") << endl;
  } else {
    cout << best << " " << F[best];
  }
  return 0;
}