import strutils, sequtils
discard stdin.readLine
var
  str1 = stdin.readLine.strip(true, false, {'.'})
  str2 = str1
  res1, res2 = 0
while str1.contains("#."):
  res1 += str1.count("#.")
  str1 = str1.replace("#.", "##")

while str2.contains("#."):
  res2 += str2.count("#.")
  str2 = str2.replace("#.", "..")
echo min(res1, res2)