N=int(input())
S=input()
corner=0
start=0
for i in range(0,N):
    if S[i]=='.':
        corner+=1
    else:
        start=i
        break

black=0
for i in range(start,N):
    if S[i]=='#':
        black+=1

print(N-corner-black)