import sys
N = int(raw_input())
S = str(raw_input())
all_sharp = S.count('.')

for i in range(N):
	if S[N-i-1] == '.':
		num = i
		all_dot = S[:N-num].count('#')
		print min(all_sharp, all_dot)
		sys.exit()
	else:
		print 0