n = int(input())
s = input()

white, black = 0, 0

for i in range(n):
    if s[i] == "#":
        white = s[i:].count(".")
        break

for j in range(n):
    if s[(j+1)*(-1)] == ".":
        black = s[:(j+1)*(-1)].count("#")
        break

print(min(white, black))