#N=3
#s=".######."
#s=[s[i] for i in range(len(s))]
N=int(input())
s=input()
s=[s[i] for i in range(len(s))]
tmp=[]
for i in range(len(s)):
    count=0
    for j in range(len(s)):
        if j<=i:
            if s[j]=="#":
                count=count+1
        if j>i:
            if s[j]==".":
                count = count+1
    tmp.append(count)
       
print(min(tmp))