N = int(input())
S = input()
ans = 0
i=0
while i < N-1:
    idx = i
    if S[i] == '#' and S[i+1] == '.':
        ans += 1
        
        i += 1
        
        for j in range(1,N):
            if idx -j < 0 or idx + 1 + j > N-1 : break

            if S[idx-j] == '#' and S[idx+1+j] == '.':
                ans += 1
                i += 1
            else:
                break
    i += 1

print(ans)
        
    
    