n = int(input())
s = input()
def a (str) :
	_ans = 200000
	for i in range(n) :
		k = 0
		if str[i] == "#" :
			for j in s[0:i+1] :
				if j == "#" : k+=1
				if k > _ans : break
			for j in s[i:-1] : 
				if j == "." : k += 1
				if k > _ans : break
			if k<_ans : _ans = k
	return (_ans)
ans = a(s)
print(ans)
           