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