N = int(input())
S = input()
if S.count('.') == N or S.count('#') ==N:
  print(0)
else:
  start,end = 0,0
  for i in range(N):
    if S[i] == '#':
      start = i
      break
  for i in range(N):
    if S[-i+1] == '.':
      end = N-i+1
      break
  if start > end:
    print(0)
  else:
    M = S[start:end]
    print(min(M.count('.'),M.count('#')))