import sys input = sys.stdin.readline N=int(input()) S=input().strip() MAX=-1 for i in range(N-1,-1,-1): if S[i]=="#": MAX=max(MAX+2,N-i) print(MAX)