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

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

print(res)