n=int(input())
s=input()
p=[]
m=0
x=s.count("#.")
c=s.count("#.")
while x>0:
    x=s.count("#.")
    s=s.replace("#.","..",1)
    m+=x
    x=s.count("#.")
    if x==0:
        p.append(m)
p.append(c)
print(min(p))