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

cnt = 0
flg = 0
for i in range(N-1):
    if flg and S[i+1] == '.':
        cnt += 1
    elif S[i] == '#' and S[i+1] == '.':
        flg = 1
        cnt += 1
    else:
        flg = 0

print(cnt)
