N = int(input())
S = input()
ans = float("INF")
for i in range(1, N + 1):
    black = S[:i].count("#")
    white = S[i:].count(".")

    ans = min(ans, black + white)

    if ans == 0:
        break

print(ans)