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


min_count = n

for border in range(n + 1):
	count = 0
	for i, bw in enumerate(s):
		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)