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

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

turn_white_stones = 0
turn_black_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_white_stones += 1

    if(stones[i] == "#"):
        turn_black_stones += 1

print(min(turn_black_stones, turn_white_stones))