ans=n=int(input())
s=input()
a,b=[0],[0]
for i in s:
    if i==".":
        a+=[a[-1]+1]
        b+=[b[-1]]
    else:
        a+=[a[-1]]
        b+=[b[-1]+1]
w=s.count(".")
bl=s.count("#")
for i in range(n):
    ans=min(ans,i-a[i]+w-a[i])
    ans=min(ans,i-b[i]+bl-b[i])
print(ans)