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

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

if sl.count("#")==n or sl.count(".")==n:
	res = 0

print(res)