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

w_N = S.count(".")
ans = float('inf')
b = 0
w = 0

for i, s in enumerate(S):
    if s == "#":
        b += 1
    if s == ".":
        w += 1
    ans = min(ans,b + w_N - w)

print(ans)