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>.
if __name__ == '__main__':
	para = input('')	
	i = 0
	max_len = 0
	counter = 0
	while i < len(para):
		x = 0
		j = i
		length = 0
		started = False
		while j < len(para):
			if para[j] == '(':
				x += 1
				length += 1
				started = True
			if x != 0 and para[j] == ')':
				x -= 1
				length += 1
			if x == 0 and started == True:
				if length > max_len:
					max_len = length
				counter += 1
				i = j
				break
			j += 1
		i += 1
	if counter == 0: 
		counter = 1
	print(max_len, counter)