import sys

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

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

num = int(a[0])
haichi = a[1]
count_list = []
for i in range(num-1):
    split_haichi_1 = haichi[:i+1]
    split_haichi_2 = haichi[i+1:]
    count_1 = count(split_haichi_1)
    count_2 = count(split_haichi_2)
    count_list.append(count_1 + count_2)

print(min(count_list))
