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>.
import sys
import math
from collections import deque, defaultdict


input = lambda: sys.stdin.buffer.readline().decode().strip()
mod = 10 ** 9 + 7

def CreateMinSparseTree(arr):
    n=len(arr)
    m,i=[],1
    while i<=n:
        m.append([0]*(n-i+1))
        i*=2
    i=1
    # print(m)
    for i in range(n):m[0][i]=arr[i]
    i=1
    while 2**i<=n:
        for j in range(n-2**i+1):
            m[i][j]=min(m[i-1][j],m[i-1][j+2**(i-1)])
        i+=1
    return m
def RMinQ(M,i,j):
    # M=CreateMinSparseTree(arr)
    n=j-i+1
    x=int(math.log(n,2))
    r=2**x
    return min(M[x][i],M[x][j-r+1])

def ceil(x, y):
    return (x + y - 1) // y
def fast_expo(n,k):
    if k==0:return 1
    if k==1:return n%mod

    if k%2==0:return fast_expo(n,k//2)*fast_expo(n,k//2)%mod
    return fast_expo(n,k//2)*fast_expo(n,k//2)*n%mod


def maxSubArraySum(a):
    size=len(a)
    max_so_far = -float('inf')
    max_ending_here = 0

    for i in range(0, size):
        max_ending_here = max_ending_here + a[i]
        if (max_so_far < max_ending_here):
            max_so_far = max_ending_here

        if max_ending_here < 0:
            max_ending_here = 0
    return max_so_far
def nCr_mod(n, r, mod):
    num = 1
    den = 1

    for i in range(r):
        num = (num * (n - i)) % mod

    for i in range(1, r + 1):
        den = (den * i) % mod
    den_inv = pow(den, mod - 2, mod)
    result = (num * den_inv) % mod

    return result

def binary_search(arr, target):
    low = 0
    high = len(arr) - 1
    index = -1

    while low <= high:
        mid = low + (high - low) // 2
        if arr[mid] == target:
            index = mid
            break
        elif arr[mid] < target:
            low = mid + 1
        else:
            high = mid - 1

    if index != -1:
        return index
    else:
        return high


s=input()
n=len(s)
dp=[0]*(n+1)
dp[0]=1
for i in range(1,n+1):
    if s[i-1]=='(':dp[i]=0
    else:
        if i>2 and s[i-2]=='(':
            dp[i]+=dp[i-2]
        elif i>2 and s[i-2]==')':
            j=i-dp[i-1]-1
            if j>0 and s[j-1]=='(':dp[i]=dp[j-1]+dp[i-1]
            else:dp[i]=0
        else:dp[i]=0
print(max(dp),dp.count(max(dp)))































































































