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

flg = False
countw = 0
countb = 0
tmpb = 0
for l in s:
    if l=="#":
        flg = True
        tmpb+=1
    else:
        if flg:
            countw+=1
            countb+=tmpb
            tmpb=0

print(min(countw,countb))



