import string

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

borders = []
count = 0
while s[count:]:
	if s.find('.#', count) != -1:
		borders.append(s.find('.#', count) + 1)
		count = s.find('.#', count) + 1
	else:
		break

numbers = []
for b in borders:
	if s[b:].count('.') is not None:
		numbers.append(s[b+2:].count('.') + s[:b-1].count('#'))
# print(left_black)
# print(right_white)
# print(s[left_black+1:])
# print(s[:right_white])
# print(s[left_black+1:].count('.'))
# print(s[:right_white].count('#'))
# print(borders)
# print(numbers)

if not numbers:
	print(0)
else:
	print(min(numbers))