n = int(input())
s = input()
count_list = []

res_list = []

for i in range(n+1):
	str = i*'.' + (n-i)*'#'
	res_list.append(str)

for dif in res_list:
	count = 0
	for index in range(n):
		if(s[index] != dif[index]):
			count += 1
	count_list.append(count)
print(min(count_list))
