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 main() {
  string seq;
  cin >> seq;
  map<int, int> mp;
  int co = 0, st = 0, i = 0, coans = 0, comax = 0, l = seq.length();
  while (i < l) {
    if (seq.at(i) == '(')
      ++co;
    else if (seq.at(i) == ')')
      --co;
    if (co < 0) {
      co = 0;
      mp.clear();
      st = i + 1;
    } else if (co == 0) {
      if (((i + 1) - st) > comax) {
        comax = i + 1 - st;
        coans = 1;
      } else if ((i + 1 - st) == comax) {
        ++coans;
      }
    } else {
      if (mp[co] != 0 && seq.at(i) == ')') {
        int le = i + 1 - mp[co];
        if (le > comax) {
          comax = le;
          coans = 1;
        } else if (le == comax) {
          ++coans;
        }
      } else
        mp[co] = i + 1;
    }
    ++i;
  }
  if (coans == 0)
    printf("0 1\n");
  else
    printf("%d %d\n", comax, coans);
  return 0;
}