N = int(input())
S = list(input())
 
check_black_stone = False
check_white_stone = False
change_counter_typeA = 0
change_counter_typeB = 0
 
 
for stone_color in S:
    if check_black_stone and stone_color == ".":
        change_counter_typeA += 1
    elif stone_color == "#":
        check_black_stone = True
 
for stone_color in S[::-1]:
    if check_white_stone and stone_color == "#":
        change_counter_typeB += 1
    elif stone_color == ".":
        check_white_stone = True
 
result = change_counter_typeA if change_counter_typeA < change_counter_typeB else change_counter_typeB
print(result)