n=int(input())
s=list(input())
sharp=[]
dot=[]
c=s[0]
if s[0]!=".":
    dot.append(0)
cnt=1
i=0
while i<n-1:
    while True:
        if s[i+1]==s[i]:
            cnt+=1
            i+=1
            if i>=n-1:
                if s[i-1]==".":
                    dot.append(cnt)
                else:
                    sharp.append(cnt)
                break
        else:
            if s[i]==".":
                dot.append(cnt)
            else:
                sharp.append(cnt)
            i+=1
            cnt=1
            break
if s[-2]!=s[-1]:
    if s[-1]==".":
        dot.append(1)
    else:
        sharp.append(1)
if len(dot)>len(sharp):
    sharp.append(0)
ans=sum(dot[1:])
tmp=0
for i in range(len(dot)-1):
    tmp=ans-dot[i+1]+sharp[i]
    ans=min(tmp,ans)
print(ans)