N=int(input())
S=input()
s=[]
kuro = S.count("#")
shiro = S.count(".")
Slist =list(S)
if Slist[N-1] == ".":
	s=S.split("#")
	if (len(s)) == 2:
		print(1)
	else:
		if Slist[N-1] == "#":
			print(min(kuro-1,shiro))
		else:
			print(min(kuro,shiro))
		
else:
	if Slist[N-1] == "#":
		print(min(kuro-1,shiro))
	else:
		print(min(kuro,shiro))