N=int(input())
S=input()
leftid=-1
cnt=0
for i in range(N):
    if S[i]=="#":
        leftid=i
        break
if leftid!=-1:
    for i in range(leftid,N,1):
        if S[i]==".":
            cnt=cnt+1
    print(cnt)
else:
    print("0")