n = int(input())
s = input()
#white
i=0
num=0
while s[i]==".":
    num+=1
    i+=1
    if i == n:
        break
#  ..##.#..
n = s.count(".")
answ = n-num

#black
j=-1
numb
while s[j]=="#":
    numb+=1
    j-=1
    if j*(-1) == n:
        break
m = s.count('#')
ansb=m-numb

if ansb<=answ:
    print(ansb)
else:
    print(answ)
