# -*- coding: utf-8 -*-

trial_num = int(input())
stones = list(input())

turn_stones = 0
count_start = False

for i in range(trial_num):
    if(count_start == False):
        if(stones[i] == "#"):
            count_start = True
    else:
        if(stones[i] == "."):
            turn_stones += 1

print(turn_stones)