N=int(input())
S=list(input())
dot=0
sha=0
s_r=list(reversed(S))
#print(s_r)
for i in range(N):
    if S[i] == ".":
        dot=i
        break
for i in range(N):
    if s_r[i] == "#":
        sha=i
        break
#print(dot)
#print(sha)
print(dot+sha)