N=input()
S=raw_input()
L=[0]

for i,x in enumerate(S):
	if x=="#":
		L.append( L[-1]+1 )
	else:
		L.append( L[-1] )
			

ans=float("inf")
for i in range(N+1):
	b=L[i]	# black on left
	w=N-i-(L[-1]-L[i])
	ans=min(ans , b+w)

print ans