n = int(input())
s = input()

black = []
white = []

cb=0
cw=0
for l in s:
    if l =="#":
        cb+=1
    else:
        cw+=1
    black.append(cb)
    white.append(cw)

ans = []
for i in range(len(s)):
    ans.append(min(white[i],black[-1]-black[i]))

print(min(ans))



