from sys import stdin
N = int(stdin.readline().rstrip())
ans = stdin.readline().rstrip()
sum = 0
left = 0
right = 0
for itr in range(0,len(ans)):
    count_dot = 0
    count_sharp = 0
    left = itr
    right = left + 1
    if left == len(ans)-1:
        break
    if ans[left] == '#' and ans[right] == '.':
        while(right < N and ans[right] == '.'):
            count_dot += 1
            right += 1
        while(left >= 0 and ans[left] == '#'):
            count_sharp += 1
            left -= 1
        if tmp != 0:
            count += 1
        sum += max(count_dot, count_sharp)
print(count)