N=int(input())
S=list(input())

minimum=N
white=S.count(".")
black=S.count("#")
countw=0
countb=0
for i in range (N):
  if S[i]==".":
    countw +=1
  else:
    countb +=1
  minimum=min(minimum, countb+white-countw)
print(minimum)
