N = int(input())
S = input()
B_end = 0

if len(S) == 0:
	print(0)
else:
	for n in range(N):
		if S[n:n+2] == "#." :
			M = n+1
			break
		else:
			M = len(S)+1
	for j in range(N):
		if S[-(j+1)] == "#":
			B_end += 1
		if S[-(j+1)] == ".":
			break
	for k in range(N):
		if S[-(k+2):-k] == "#.":
			Mdual = -k-1
			break
		else:
			Mdual = len(S) + 1
	WB = S[M:].count(".")
	BW = max(1, S[:Mdual].count("#"))
	print(min(WB , BW))

