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

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

min_turn_stones = 2 * 10 ** 5

for i in range(trial_num):
    tmp_min = stones[:i].count("#") + stones[i+1:].count(".")
    if (tmp_min < min_turn_stones):
        min_turn_stones = tmp_min

print(min_turn_stones)