n = int(input())
l = list(input().strip())

lb, lw, rb, rw = 0, 0, l.count("#"), l.count(".")


ans = lb+rw
for i in range(len(l)):
    if l[i] == "#":
        lb += 1
        rb -= 1
    else:
        lw += 1
        rw += 1

    ans = min(ans, lb+rw)
print(ans)
