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>.
# Problem: C. Longest Regular Bracket Sequence
# Contest: Codeforces - Codeforces Beta Round #5
# URL: https://codeforces.com/problemset/problem/5/C
# Memory Limit: 256 MB
# Time Limit: 2000 ms

import sys
import bisect
import random
import io, os
from bisect import *
from collections import *
from contextlib import redirect_stdout
from itertools import *
from array import *
from functools import lru_cache
from types import GeneratorType
from heapq import *
from math import sqrt, gcd, inf

if sys.version >= '3.8':  # ACW没有comb
    from math import comb

RI = lambda: map(int, sys.stdin.buffer.readline().split())
RS = lambda: map(bytes.decode, sys.stdin.buffer.readline().strip().split())
RILST = lambda: list(RI())
DEBUG = lambda *x: sys.stderr.write(f'{str(x)}\n')

MOD = 10 ** 9 + 7
PROBLEM = """https://codeforces.com/problemset/problem/5/C

输入括号字符串 s，长度不超过 1e6。

输出 s 的最长合法括号子串的长度和数量。
如果不存在，输出 0 1。
输入 )((())))(()())
输出 6 2

输入 ))(
输出 0 1
"""
"""令f[i]表示以i位置为结尾的最长合法子串。
显然s[i]=='('则f[i] = 0，否则分类讨论
若 s[i-1]=='(' 则只能这俩匹配，f[i] = f[i-2] + 2
若 f[i-1]>0则说明前边挨着一段合法串，i只能和合法串左边的'('匹配；同时，若匹配成功，新串左边挨着合法串，也要加上。
实现时，在s之前增加一个')'避免讨论边界0
"""


#       ms
def solve():
    s, = RS()
    n = len(s)
    s = ')' + s
    ans, cnt = 0, 1
    f = [0] * (n + 1)
    for i, c in enumerate(s[2:], start=2):
        if c == '(':
            continue
        if s[i - 1] == '(':
            f[i] = f[i - 2] + 2
        elif f[i - 1] and s[i - f[i - 1] - 1] == '(':
            f[i] = f[i - 1] + 2 + f[i - f[i - 1] - 2]
        if ans < f[i]:
            ans = f[i]
            cnt = 1
        elif ans == f[i] > 0:
            cnt += 1

    ")(())"
    print(ans, cnt)


if __name__ == '__main__':
    solve()
