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;
mt19937_64 rd(time(0));
template <typename T>
T gcd(T a, T b) {
  return (b == 0) ? a : gcd(b, a % b);
}
template <typename T>
T lcm(T a, T b) {
  return a / gcd(a, b) * b;
}
template <typename T>
T i_rand(T l, T r) {
  return uniform_int_distribution<T>(l, r)(rd);
}
template <typename T>
T r_rand(T l, T r) {
  return uniform_real_distribution<T>(l, r)(rd);
}
string s;
int n;
deque<int> d;
int c[1000005], rs = 0, cnt = 0;
signed main() {
  ios_base::sync_with_stdio(0), cin.tie(NULL), cout.tie(NULL);
  cin >> s;
  n = s.size();
  s = " " + s;
  d.push_back(0);
  for (int i = 1; i <= n; ++i) {
    if (s[i] == '(') d.push_back(i);
    if (s[i] == ')' && d.back() != 0)
      c[i] = c[d.back() - 1] ? c[d.back() - 1] : d.back(), d.pop_back();
  }
  for (int i = 1; i <= n; ++i)
    if (c[i] && s[i] == ')') rs = max(rs, i - c[i] + 1);
  cout << rs << ' ';
  if (rs == 0) return cout << 1, 0;
  for (int i = 1; i <= n; ++i)
    if (c[i] && i - c[i] + 1 == rs) ++cnt;
  cout << cnt;
  return cerr << "\nTime: " << setprecision((6)) << fixed
              << (clock() / double(CLOCKS_PER_SEC)) << " sec.\n",
         0;
}