n = int(input())
s = input()
 
def a(str) :
	for i in range(n) :
		if str[i] == "#" : return i
	return -1
index = a(s)
ansW = 0
ansB = 0
if index != -1 :
	for i in range(index, n) :
		if s[i] == "." : ansW +=1
		else : ansB += 1
print (min(ansW,ansB))