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