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

if S.count('.') == 0 or S.count('#') == 0:
  print('0')
  exit()

middle = S[1:-1]
white = middle.count('.')
black = middle.count('#')

if white < black:
  if S[-1] == '.':
    print(white+1)
  else:
    print(white)
else:
  if S[0] == '#':
    print(black+1)
  else:
    print(black)
