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

res = dot = S.count(".")
sha = 0
for i in range(N):
    if S[i] == "#":
        sha += 1
    else:
        dot -= 1
    tmp = sha + dot
    res = min(res, tmp)

print(res)