argN = int(input())
argS = input()
aryS = list(argS)

idxBorder = 0
ansMin = 1000000

for i in range(argN+1):
  if i == 0:
    #cntW1 = 0
    cntB1 = 0
  else:
    #cntW1 = aryS[:i].count(".")
    cntB1 = aryS[:i].count("#")

  if i == argN:
    cntW2 = 0
    #cntB2 = 0
  else:
    cntW2 = aryS[i:].count(".")
    #cntB2 = aryS[i:].count("#")
  #print(str(i) + "," + str(cntB1) + "," + str(cntW2))
  ansMin = min(ansMin,cntB1 + cntW2)
print(ansMin)