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

ans = 0
white, black = 0, 0
blackFlag = 0
for i in range(N):
    if S[i] == "." and blackFlag:
        white += 1
    if S[i] == "#":
        black += 1
        blackFlag = True

print(min(white, black))

