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;
const int maxn = 1e6 + 10;
string s;
stack<int> st;
vector<pair<int, int> > t, v;
int cnt[maxn], m;
int main() {
  ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  ;
  cin >> s, s = ' ' + s;
  int n = s.size() - 1;
  for (int i = 1; i <= n; i++) {
    if (!st.empty() && s[i] == ')') {
      t.push_back({st.top(), i});
      st.pop();
    }
    if (s[i] == '(') st.push(i);
  }
  if (t.empty()) return cout << "0 1", 0;
  while (!st.empty()) st.pop();
  sort(t.begin(), t.end());
  for (int i = t.size() - 1; i >= 0; i--) {
    while (!st.empty() && t[st.top()].first > t[i].first &&
           t[st.top()].second < t[i].second)
      st.pop();
    st.push(i);
  }
  vector<pair<int, int> > v;
  while (!st.empty()) v.push_back(t[st.top()]), st.pop();
  sort(v.begin(), v.end());
  v.push_back({v[v.size() - 1].second + 1, v[v.size() - 1].second + 1});
  m = 1;
  for (int i = 0; i <= v.size() - 2; i++) {
    cnt[m] += v[i].second - v[i].first + 1;
    if (v[i].second + 1 != v[i + 1].first) ++m;
  }
  int A = 0, B = 0;
  for (int i = 1; i <= m; i++) A = max(A, cnt[i]);
  for (int i = 1; i <= m; i++)
    if (A == cnt[i]) ++B;
  cout << A << " " << B;
}