n=int(input())
s=input()
sl=list(s)

bi=0
wi=0
b=[]
w=[]
for i in range(n):
	if sl[i] == "#":
		bi = bi+1
	else:
		wi = wi+1
	b.append(bi)
	w.append(wi)

c=0
res=2*10**5
for i in range(n-1):
	if sl[i]=="#" and sl[i+1]==".":
		c = b[i] + w[n-1]-w[i]
		#print(c)
		if c < res:
			res = c

w0=w[n-1]
b0=b[n-1]
if w0<res:
	res=w0
if b0<res:
	res=b0

print(res)
#print(w)
#print(b)