import sys
N = int(sys.stdin.readline().rstrip())
S = list(map(str, sys.stdin.readline().rstrip()))

right = 0
cond = 0
white, black = 0,0
for s in S[::-1]:
	if cond == 0:
		if s == '#':
			right += 1
		else:
			white += 1
			cond = 1

	else:
		if s == '#':
			black += 1
		else:
			white += 1

if cond == 0:
	print(0)
elif black == 0:
	print(0)
else:
	print(min(black,white))
