from sys import stdin
N = int(stdin.readline().rstrip())
ans = stdin.readline().rstrip()
count = 0
right = 0
for left in range(0,len(ans)):
    right = left+1
    if left == len(ans)-1:
        break
    if ans[left] == '#':
        while(right < N and ans[right] == '.'):
            count += 1
            right += 1
        left = right
        if left == right:
            right += 1

print(count)