N = int(input())
S = input()
count = 0
bunki = N
countb = 0
l = N-1
for i in range(0, N):
	if(S[i] == '#'):
		bunki = i
		break
if(bunki != N):
	for j in range(bunki, N):
		if(S[j] == '.'):
			count += 1
		else:
			countb += 1 
	while(0 < l):
		if(S[l] == '#'):
			countb -= 1
		else:
			break
		l -= 1
if(countb < count):
	print(countb)
else:
	print(count)