import sys

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

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

# 左側を全部白にする手数 (= 左側の黒の数)
split_left_count = [sum([x == '#' for x in haichi[:i]]) for i, k in enumerate(haichi)]

# 右側を全部黒にする手数 (= 右側の白の数)
split_right_count = [sum([x == '.' for x in haichi[i:]]) for i, k in enumerate(haichi)]

count_list = [split_right_count[i]+split_left_count[i] for i in range(len(split_right_count))]

print(min(count_list))
