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

black = -1
white = N

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

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

cnt_white = S[black+1:].count(".")
cnt_black = S[:white].count("#")
ans = min(cnt_white,cnt_black)
print(ans)
