import sys

def count(split_haichi):
    black_count = sum([x == '#' for x in split_haichi])
    white_count = len(split_haichi) - black_count
    return min(black_count, white_count)

a = []
for l in sys.stdin:
    a.append(l)

num = int(a[0])
haichi = a[1]
count_list = []

black_all_count = sum([x == '#' for x in haichi])
white_all_count = num - black_all_count
for i in range(num-1):
    split_haichi_1 = haichi[:i+1]
    split_haichi_2 = haichi[i+1:]

    black_count_1 = sum([x == '#' for x in split_haichi_1])
    white_count_1 = len(split_haichi_1) - black_count_1

    black_count_2 = black_all_count - black_count_1
    white_count_2 = white_all_count - white_count_1

    count_list.append(min(black_count_1, white_count_1) + min(black_count_2, white_count_2))

print(min(count_list))
