n = input()
s = list(input())
 
ans = len(s)

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

for i in range(len(s)):
	temp_ans = 0
	for j in range(0, i):
		if(s[j]) == "#":
			temp_ans += 1
	for j in range(i,len(s)):
		if (s[j] == "."):
			temp_ans += 1
	ans = min(ans, temp_ans, len(s) - dot)
 
print(ans)