n = input()
s = list(input())

sharp = 0
dot = 0
for string in s:
	if(string == "#"):
		sharp += 1
	else:
		dot += 1 


sb = s.copy()

ans = 0

for i in range(len(s)-1):
	if(s[i] == "#" and s[i+1] == "."):
		if(i == 0):
			s[i] = "."
		elif(i > 0 and s[i-1] != "#"):
			s[i] = "."
		else:
			s[i+1] = "#"
		ans += 1

ansb = 0
for i in range(len(sb)-1):
	if(i == 0 and sb[i] != "."):
		sb[i] = "."
		ansb += 1
	elif(sb[i] == "#" and sb[i+1] == "."):
		if(i > 0 and sb[i-1] != "#"):
			sb[i] = "."
		else:
			sb[i+1] = "#"
		ansb += 1


#print(s)
#print(sb)


#print(ans)
#print(ansb)

ans = min(ans, ansb, len(s) - sharp, len(s) - dot)

print(ans)