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