n=int(input()) s=list(input()) nod=[] for i in range(n): if s[i]=="#": nod.append(i+1) dp=[-1]*(n+3) for ind in range(len(nod)-1,-1,-1): i=nod[ind] if ind==len(nod)-1: dp[i]=n-i+1 continue j=nod[ind+1] t=dp[j]-1 ni=i+t if ni