n = int(input())
s = input()
ansW = 0
ansB = 0

def indB(str) :
	for i in range(n) :
		if str[i] == "#" : 
			return i
	return -1

indexB = indB(s)
if indexB != -1 :
	for i in range(indexB, n) :
		if s[i] == "." : 
			ansW += 1
            
def indW(str) :
	for i in range(n-1,0,-1) :
		if str[i] == "." : 
			return i
	return -1

indexW = indW(s)
if indexW != -1 :
	for i in range(indexW-1,0,-1) :
		if s[i] == "#" : 
			ansB += 1

print (min(ansW,ansB))