N = int(input())
S = list(input())
memo = 0
count = 0
if "#" in S:
    for i in range(N):
        if S[i] == "#":
            memo = i
            S_right = S[i+1:]
            count = S_right.count(".")
            break

print(count)