import sequtils, strutils, algorithm, math

var
  n = readLine(stdin).parseInt
  s = readLine(stdin)
  firstBlack = s.find('#')
  res = 0

if firstBlack == -1:
  echo 0
  quit 0
else:
  var s2 = s[firstBlack..(s.len - 1)]
  echo min(s2.count('#'), min(s.count('#'), s.count('.')))