mod=998244353 n=int(input()) S=input() m=(n+10)//2 dp=[[0]*m for i in range(m)] dp[0][0]=1 for s in S: dpn=[[0]*m for i in range(m)] if s=='(': for i in range(m-1): for j in range(m-1): dpn[i+1][j]+=dp[i][j] dpn[i][j+1]+=dp[i][j] else: for i in range(m-1): for j in range(m-1): dpn[i][j]+=dp[i+1][j] dpn[i][j]+=dp[i][j+1] dp=[[0]*m for i in range(m)] for i in range(m): for j in range(m): dp[i][j]=dpn[i][j]%mod print(dp[0][0])