import strutils, sequtils
discard stdin.readLine
var
  str = stdin.readLine.strip(true, false, {'.'})
  res = 0
while str.contains("#."):
  res += str.count("#.")
  str = str.replace("#.", "##")
echo res