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>.
#https://codeforces.com/contest/5/problem/C

def empty(l):
    return len(l) == 0

def longest_regular_bracket_sequence(str):
    l = 0
    cnt = 0
    st = []
    ml = 0

    for ch in str:
        if ch == ')':
            if not empty(st):
                st.pop()
                l += 2
            else:
                l = 0
            if empty(st):
                if l == ml:
                    cnt += 1
                if l > ml:
                    ml = l
                    cnt = 1
        else:
            st.append(ch)
        # print(st)

    if ml == 0:
        cnt = 1

    return (ml, cnt)


s = input()
(ml, cnt) = longest_regular_bracket_sequence(s)
print(ml, cnt)