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() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  string str_01;
  cin >> str_01;
  int Front = 0, Back = 0, Max1 = 0, Max2 = 0, mem = 0, Count = 0;
  for (int x = 0; x < str_01.size(); x++) {
    if (str_01[x] == '(') {
      Front++;
      mem++;
    } else {
      if (Front > 0) {
        Front--;
        mem++;
        if (x == str_01.size() - 1) {
          if (Front == 0 && mem > Max1) Max1 = mem;
        }
      } else {
        if (Front == 0) {
          if (mem > Max1) Max1 = mem;
          mem -= mem;
        }
      }
    }
  }
  mem = 0;
  for (int x = str_01.size() - 1; x >= 0; x--) {
    if (str_01[x] == ')') {
      Back++;
      mem++;
    } else {
      if (Back > 0) {
        Back--;
        mem++;
        if (x == 0) {
          if (Back == 0 && mem > Max2) Max2 = mem;
        }
      } else {
        if (Back == 0) {
          if (mem > Max2) Max2 = mem;
          mem -= mem;
        }
      }
    }
  }
  if (max(Max1, Max2) != 0) {
    if (Max1 >= Max2) {
      Front = 0, mem = 0;
      for (int x = 0; x < str_01.size(); x++) {
        if (str_01[x] == '(') {
          Front++;
          mem++;
        } else {
          if (Front > 0) {
            Front--;
            mem++;
            if (x == str_01.size() - 1) {
              if (Front == 0 && mem == Max1) Count++;
            }
          } else {
            if (Front == 0) {
              if (mem == Max1) Count++;
              mem -= mem;
            }
          }
        }
      }
      cout << Max1 << " " << Count << "\n";
    } else {
      Back = 0, mem = 0;
      for (int x = str_01.size() - 1; x >= 0; x--) {
        if (str_01[x] == ')') {
          Back++;
          mem++;
        } else {
          if (Back > 0) {
            Back--;
            mem++;
            if (x == 0) {
              if (Back == 0 && mem == Max2) Count++;
            }
          } else {
            if (Back == 0) {
              if (mem == Max2) Count++;
              mem -= mem;
            }
          }
        }
      }
      cout << Max2 << " " << Count << "\n";
    }
  } else
    cout << "0 1\n";
  return 0;
}