N = int(input())
S = input()
ans = float("INF")

for i in range(N+1):
    left = S[0:i]
    right = S[i::]
    cnt_left = left.count("#")
    cnt_right = right.count(".")
    change_stone = cnt_left + cnt_right
    ans = min(ans, change_stone)
print(ans)