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

ans = 1000000000000
for i in range(1, len(l)):
    b1 = 0
    b2 = 0
    w1 = 0
    w2 = 0
    for j in range(i):
        if l[j] == "#":
            b1 += 1
        else:
            w1 += 1
    for j in range(i, len(l)):
        if l[j] == ".":
            w2 += 1
        else:
            b2 += 1

    ans = min(ans, b1+b2, w1+w2, b1+w2)

print(ans)
