n = int(input())
s = input()
c = 0
sl = list(s)
if n > 2:
  for i in range(n-2):
   if sl[i]=="#" and sl[i+1]==".":
      if sl[i+2]=="." and sl[i-1]==".":
        sl[i]='.'
        c = c + 1
      elif sl[i+2]=="." and sl[i-1]=="#":
        sl[i+1]='#'
        sl[i+2]='#'
        c = c + 2
      elif sl[i+2]=="#" and sl[i-1]=="#":
        sl[i+1]='#'
        c = c + 1
      elif sl[i+2]=="#" and sl[i-1]==".":
        sl[i]='#'
        c = c + 1
      elif sl[i+2]=="#":
        sl[i+1]='#'
        c = c + 1
  if sl[n-2]=="#" and sl[n-1]==".":
    sl[i+1]='#'
    c=c+1
elif n == 2:
  if s=="#.":
    c=c+1
else:
  pass
print(c)