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.
The first line of the input file contains a non-empty string, consisting of «(» and «)» characters. Its length does not exceed 10<sup class="upper-index">6</sup>.
# -*- coding: utf-8 -*-
"""
Created on Fri Mar  6 12:09:25 2020

@author: akprasad

5C. Longest Regular Bracket Sequence
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

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
"""

if __name__ == '__main__':
    brackets = input()
    longest = 0
    counter = 0
    cur_length = 0
    count_of_longest = 0
    for b in brackets:
        if b == "(":
            counter += 1
            cur_length += 1
        elif counter and b == ")":
            counter -= 1
            cur_length += 1
        else:
            cur_length = 0

        if counter == 0:
            if longest < cur_length:
                longest = cur_length
                count_of_longest = 1
            elif longest == cur_length:
                count_of_longest += 1
    
    if longest == 0:
        print("0 1")
    else:
        print("{} {}".format(longest, count_of_longest))
