n = int(input())
s = list(input())


min_count = n
index_list = [i for i in enumerate(s)]

for border in range(n):
	count = 0
	for i, bw in index_list:
		if i < border and bw == '#':
			count += 1
		elif i >= border and bw == '.':
			count += 1
            
		if count >= min_count:
			break

	if min_count > count:
		min_count = count

print(min_count)