N = int(input())

S = str(input())

target = S[0]
cnt = 0
for i in range(1, N):
    if target == '#' and S[i] == '.':
        cnt += 1
        target = '.'
        continue
    if S[i] == '#':
        target = '#'

print(cnt)
