N=int(input())
S=input()
S=S+'9'
ans=0
for i in range(N):
    if S[i]=='#' and S[i+1]=='.':
        cntj=0
        for j in range(i,-1,-1):
            if S[j]=='#':
                cntj+=1
            else:
                break
        cntk=0
        for k in range(i+1,N+1):
            if S[k]=='.':
                cntk+=1
            else:
                break
        if cntj < cntk:
            ans += cntj
            S = S[:i-cntj]+'.'*cntj+S[i+1:]
        else:
            ans += cntk
            S = S[:i]+'#'*cntk+S[i+1+cntk:]
print(ans)