n=int(raw_input())
s=raw_input()
ret=n
for i in range(n+1):
    head=s[:i]
    tail=s[i:]
    temp=head.count("#")+tail.count(".")
    if temp<ret:
        ret=temp
    if temp==0:
        ret=0
        break
print(ret)
