n=int(input())
s=input()
S=list(s)
m=0
if S[0]=='#':
    for i in range(1,n):
        if S[i]=='.':
            m=m+1
        else:
            continue
                

else:
    for i in range(1,n):
        if S[i]=='.':
            if S[i-1]=='#':
                m=m+1
                S[i]='#'
            else:
                continue
        else:
            continue

print(m)
