n=int(input())
s=input()
S=list(s)
m=0

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

print(m)