N = int(input())
S = input()

l = 0
r = N-1

for i in range(N):
    if S[i] == ".":
        l = i
        break

for i in range(N)[::-1]:
    if S[i] == "#":
        r = i
        break

ans = N -(r - l + 1)
print(ans)