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

Bflag = False
countA = 0
countB = 0
for i in range(N):
  if S[i] == '#':
    Bflag = True
    countB = countB + 1
  elif Bflag is True:
    countA = countA + 1

if countA < countB:
  print(countA)
else:
  if countB == 1:
    print(0)
  else:
    print(countB)
