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

flug = False
cnt = 0
for i,n in enumerate(S):
    if S[i]=='#':
        flug=True
    else:
        if flug and S[i]=='.':
            cnt+=1
        flug=False
    
print(cnt)