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

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

min_turn_stones = 2 * 10 ** 5
right_black_stone = 0
left_white_stone = stones.count(".")


for i in range(trial_num):
    if(stones[i] == "#"):
        right_black_stone += 1
    else:
        left_white_stone -= 1

    tmp_min = right_black_stone + left_white_stone
    if(tmp_min < min_turn_stones):
        min_turn_stones = tmp_min


print(min_turn_stones)