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

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

min_turn_stones = 2*10**5

black_stones = stones.count("#")
white_stones = trial_num - black_stones

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

print(min_turn_stones)