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

ans=float("inf")
for i in range(n+1):
    left=s[0:i]
    right=s[i:n]
    tmp=(left.count("#")+right.count("."))
    # print(left,right,tmp)
    ans=min(ans,tmp)
    
print(ans)