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

b = 0
w = 0
stones = []
for i in S:
    if i == "#":
        b += 1
    else:
        w += 1
    stones.append((b,w))

bb = S.count("#")
ww = N-bb

ans = 1e9

for b,w in stones:
    ans = min(ans,b+ww-w)

print(ans)