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

right_white = N
for i in range(N - 1, -1, -1):
    if S[i] == ".":
        right_white = i
        break
left_black = 0
for i in range(N):
    if S[i] == "#":
        left_black = i
        break

print(
    min(
        S[left_black:].count("."),
        S[:right_white].count("#"),
        S.count("."),
        S.count("#"),
    )
)
