N=int(input())
S=input()

sign = True
change1 = len(S)
change2 = len(S)

for i in range(len(S)-1):
	if S[i] !=S[i+1]:
		if sign:
			change1 = i+1
			sign = False
		else:
			change2 = i+1
			break
if S[0] == '.':
	print(min(S.count('.'),S[change1:].count('.')))
else:
	print(min(S.count('.'),S[change2:].count('.')+change1))