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>.
s=input()
dct={}
l=len(s)
lst=[]
arr=[]
for i in range(l):
    if(s[i]=="("):
        lst.append(i)
    else:
        if(len(lst)!=0):
            larr=len(arr)
            j=lst[-1]
            name=str(j)+" "+str(i)
            dct[name]=2
            del lst[-1]
            if(larr!=0):
                last=arr[-1].split(" ")
                if(int(last[0])<i and int(last[0])>j):
                    dct[name]=dct[arr[-1]]+dct[name]
                    del dct[arr[-1]]
                    del arr[-1]
                    if(larr!=1):
                        last = arr[-1].split(" ")
                if(j-int(last[1])==1):
                    dct[name] = dct[arr[-1]] + dct[name]
                    del dct[arr[-1]]
                    del arr[-1]
            arr.append(name)
m=list(dct.values())
if(len(m)==0):
    print(0,1)
else:
    mx=max(m)
    c=0
    for i in m:
       if(i==mx):
           c+=1
    print(mx,c)

#


