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] == "#":
        print(i)
        index = N - 1 - i
        break

ans += N - index - 1

for j in range(index):
    if S[index - 1 - j] == ".":
        index2 = index - 1 - j


for k in range(index2):
    if S[k] == "#":
        ans += 1

print(ans)
