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 JAVA):

Solution:
//package projects;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;

public class CF5C
{
  public static void main(String[] args) throws IOException
  {
    BufferedReader sc = new BufferedReader(new InputStreamReader(System.in));
    char[] items = sc.readLine().toCharArray();
    ArrayList<Character> openBrackets = new ArrayList<Character>();
    int currentSequence = 0; //l
    int longestSequence = 0; //h
    int substrings = 1; //n
    int count = -1;
    
    for (int i = count + 1; i < items.length; i++)
    {
      longestSequence += items[i] == '(' ? 1 : -1;
      if (longestSequence == 0)
      {
        if (currentSequence < i - count)
        {
          currentSequence = i - count;
          substrings = 1;
        }
        else if (currentSequence == i - count)
        {
          substrings++;
        }
      }
      else if (longestSequence < 0)
      {
        count = i;
        longestSequence = 0;
      }
    }
    if (longestSequence == 0)
    {
      System.out.println(currentSequence + " " + substrings);
      return;
    }
    
    longestSequence = 0;
    int temp = count;
    count = items.length;
    for (int i = count - 1; i > temp; i--)
    {
      longestSequence += items[i] == ')' ? 1 : -1;
      if (longestSequence == 0)
      {
        if (currentSequence < count - i)
        {
          currentSequence = count - i;
          substrings = 1;
        }
        else if (currentSequence == count - i)
        {
          substrings++;
        }
      }
      else if (longestSequence < 0)
      {
        count = i;
        longestSequence = 0;
      }
    }

    System.out.println(currentSequence + " " + substrings);

    /*
    for (int i = 0; i < items.length; i++)
    {      
      if (items[i] == '(')
      {
        openBrackets.add('(');
        //currentSequence++;
        isRegular = true;
      }
      else
      {
        if (openBrackets.size() == 0)
        {
          isRegular = false;
        }
        else
        {
          openBrackets.remove(0);
          currentSequence += 2;
          //substrings++;
          if (openBrackets.size() == 0)
          {
            endOnClose = true;
          }
          else
          {
            endOnClose = false;
          }
        }
      }
      if (isRegular == true && currentSequence != 1 && longestSequence < currentSequence)
      {
        longestSequence = currentSequence;
      }
      else if (isRegular == false)
      {
        if (currentSequence != 0)
        {
          substrings++;
        }
        currentSequence = 0;
        isRegular = true;
      }
    }
    if (longestSequence > 0 && substrings == 0)
    {
      substrings++;
    }
    else if (longestSequence == 0 && substrings == 0)
    {
      substrings++;
    }
    else if (endOnClose == true && isRegular == true && currentSequence != 0)
    {
      substrings++;
    }

    System.out.println(longestSequence + " " + substrings);
    */
  }
}