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

min_count = 10**10
for i in range(1, N):
    black = S[:i].count("#")
    white = S[i:].count(".")
    if black + white < min_count:
        min_count = black + white

print(min_count)