n = int(input())
s = input()
an = []
def a (str) :
	ans = []
	for i in range(n) :
		k = 0
		if str[i] == "#" :
			for j in s[0:i+1] :
				if j == "#" : k+=1
			for j in s[i:-1] : 
				if j == "." : k += 1
			ans.append(k)
	return (ans)
an = a(s)
if len(an) == 0 : an = {0}
print(min(an))
           