n=int(input())
st=input()
i=st.find('#.')
if i < 0:
	print('0')
else:
	counts=[st.count('#')]
	while i >= 0:
		count = st[0:i].count('#')
		count+= st[i+1:].count('.')
		counts.append(count)
		i=st.find('#.', i+1)
	print(min(counts))