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

fb=-1
flag=0
for i in range(n):
    if flag==0 and s[i]=='#':
        fb=i
        flag+=1

s1='.'*n
s2='#'*n
if n==1:
    ans=0
else:
    if fb==-1:
        ans=0
    else:
        s3='.'*fb+'#'*(n-fb)
        x=0
        y=0
        z=0
        for i in range(n):
            if s1[i]!=s[i]:
                x+=1
            if s2[i]!=s[i]:
                y+=1
            if s3[i]!=s[i]:
                z+=1
        ans=min(x,y,z)
print(ans)