n=int(input())
s=input()
w=[]
b=[]
if s[0]==".":
    w.append(1)
    b.append(0)
else:
    w.append(0)
    b.append(1)
for i in range(1,n):
    if s[i]==".":
        w.append(w[i-1]+1)
        b.append(b[i-1])
    else:
        w.append(w[i-1])
        b.append(b[i-1]+1)
ans=1000000
cnt=s.count(".")
for j in range(n):
    if ans>b[j]+cnt-w[j]:
        ans=b[j]+cnt-w[j]
print(ans)
