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
"""


#       ms
def solve():
    s, = RS()
    p = {0: -1}
    ans, cnt = 0, 1
    st = 0
    for i, c in enumerate(s):
        if c == '(':
            st += 1
        else:
            st -= 1
        if st in p:
            if ans < i - p[st]:
                ans = i - p[st]
                cnt = 1
            elif ans == i - p[st]:
                cnt += 1
        else:
            p[st] = i
        if st < 0:
            p = {0: i}
            st = 0
    print(ans, cnt)


if __name__ == '__main__':
    solve()
