N=int(input())
S=input()
ans=0
Slist=list(S)
S_changed=S
for i in range(N-1):
    if S[i]=="#" and S[i+1]==".":
            Slist[i+1]="."
            S_changed="".join(Slist)
            ans= ans+1
print(ans)
