N = int(input())
S = list(input())
siro = S.count(".")
kuro = S.count("#")
change_num = 0
if kuro < siro:
	change_num = kuro
elif kuro > siro:
	change_num = siro
else:
	# kuro == siro
	for i in range(N-1):
		if S[i] == "#" and S[i+1]==".":
			change_num = change_num + 1
print(change_num)