n=int(input()) s=input() a=-1 for i in range(n): if s[n-1-i]=="#": a=max(a+2,n-(n-1-i)) print(a)