N = int(input())
S = input()
i = 0
while S[i] == ".":
	if i == N-1:
		break
	i += 1
c = 0
t = i
while i < N:
	if S[i] == ".":
		c += 1
	i += 1
cand1 = min(c,N-t-c)

S = S[::-1]
i = 0
while S[i] == "#":
	if i == N-1:
		break
	i += 1
c = 0
t = i
while i < N:
	if S[i] == "#":
		c += 1
	i += 1
cand2 = min(c,N-t-c)
print(min(cand1,cand2))
