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 -*-
line=input()
l=len(line)
count=0
v=[0]*l
for i in range(l):
    if line[i]=='(':
        count+=1
    if line[i]==')':
        if count>0:
            v[i]=1
        count-=1
    if count<0:
        count=0
count=0
for i in range(l-1,-1,-1):
    if line[i]==')':
        count+=1
    if line[i]=='(':
        if count>0:
            v[i]=1
        count-=1
    if count<0:
        count=0
ok=0
count=0
max_num=0
for i in range(l):
    if v[i]==1:
        count+=1
    else:
        count=0
    if count>max_num:
        max_num=count
        ok=1
    elif count==max_num:
        ok+=1
if max_num==0:
    ok=1
print(max_num,ok)