N=int(input())
S=list(input())

ans=0
for i in range(1,N-1):
    if S[i]=='#':

        if S[i+1]=='.':
            ans+=1
            S[i+1]='#'

    else:

        if S[i-1]=='#':
            ans+=1

print(ans)