n = input()
s = input()
s_list = list(s)
nmone = int(n) - 1
changednum = 0
global nextchecknum
nextchecknum = 0
for num in range(nmone):
  nump = num + 1
  if nextchecknum >= nump:
    if s_list[num] == "#" and s_list[nextchecknum] == ".":
      s_list[nump] = "#"
      changednum += 1
      nextchecknum += 1
    else:
      pass
  else:
    if s_list[num] == "#" and s_list[nump] == ".":
      s_list[nump] = "#"
      changednum += 1
      nextchecknum = nump + 1
    else:
      pass
#sed = "".join(s_list)
print(changednum)