n=gets.to_i s=gets.chomp p2=1 arr=[] ans=[] s.chars{|e| if e=="(" arr<