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

S_list = list(S)
firstBlack = N
countStone = 0
for i in range(0, N):
  if(S_list[i] == "#"):
    firstBlack = i
    break

countChangeWhite = S_list[firstBlack:N].count(".")
countChangeBlack = S_list.count("#")

if(countChangeBlack < countChangeWhite):
  print(countChangeBlack)
else:
  print(countChangeWhite)