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

ans = 0
index = 0
index2 = 0

for i in range(N):
    if S.count("#") == 0:
        print(ans)
        exit()
    if S[N - 1 - i] == "#":
        index = N - 1 - i
        break

ans += N - index - 1

ans += S[:index].count(".")
print(ans)