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

l=[]
i=n
aa=s.rfind('.')
bb=s.find('.')
ans=min(s[:aa+1].count('.'),s[:aa+1].count('#'))
while i>=0:
    a=s[:i].rfind('.')
    ans=min(ans,(1+min(s[:a+1].count('.'),s[:a+1].count('#'))))
    #print(ans,a)
    i=a
    if a==bb:
        break

print(ans)

