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>
inline int sbt(int x) { return __builtin_popcount(x); }
using namespace std;
template <typename Arg1>
void __f(const char* name, Arg1&& arg1) {
  cout << name << " : " << arg1 << std::endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args) {
  const char* comma = strchr(names + 1, ',');
  cout.write(names, comma - names) << " : " << arg1 << " | ";
  __f(comma + 1, args...);
}
stack<int> st;
int dp[1000005];
int main() {
  cin.sync_with_stdio(false);
  cout.sync_with_stdio(false);
  string s;
  cin >> s;
  int n = s.size();
  int maxi = 0, lng = 1, len;
  memset(dp, -1, sizeof dp);
  for (int i = 0; i < n; i++) {
    if (s[i] == '(') {
      st.push(i);
    } else {
      if (st.empty()) continue;
      int last_ind = st.top();
      st.pop();
      int len = i - last_ind + 1;
      if (dp[last_ind - 1] != -1) len = len + dp[last_ind - 1];
      if (maxi < len) {
        maxi = len;
        lng = 1;
      } else if (len == maxi) {
        lng++;
      }
      dp[i] = len;
    }
  }
  cout << maxi << " " << lng << endl;
  return 0;
}