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

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

min_turn_stones = 2*10**5

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

print(min_turn_stones)