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

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

print(max(countw,countb))



