
#### input

a = []
c = []

ln = gets
nx = ln.match(/([0-9]+)[ ]+([0-9]+)/)
h = nx[1].to_i
w = nx[2].to_i

#print "h:#{h} w:#{w}\n"
#exit

#### set a[], b[]

0.upto(h-1) { |i|
  ln = gets
  x = []
  0.upto(w-1) { |j|
    if ln[j] == "#"
      x << 1
      c << [i,j]
    else
      x << 0
    end
    #sz = ln.size
    #ln = ln.slice(1..(sz-1))
    #print "i:#{i} j:#{j} x:#{x} ln:#{ln}\n"
  }
  a << x
  #print "i:#{i} a:#{a} c:#{c}\n"
}

##

cnt = 0
nc = c.size
0.upto(nc-1) { |i|
  (i+1).upto(nc-1) { |j|
    c1 = c[i]
    c2 = c[j]
    x1 = c1[0]
    y1 = c1[1]
    x2 = c2[0]
    y2 = c2[1]
    if x1 > x2 || x1 == x2 && y1 > y2
      x1,y1,x2,y2 = x2,y2,x1,y1
    end

    if y1 == y2
      next if (x1+x2)%2 > 0
      x3 = (x1+x2)/2
      y3 = y1+(x2-x1)/2
      cnt += 1 if a[x3][y3] > 0

    elsif y2-y1 == x1-x2
      x3 = 2*x1 - x2
      y3 = y2
      while x3 >= x2
        cnt += 1 if a[x3][y3] > 0
        x3 -= 1
        y3 += 1
      end

      elsif y2-y1 == x2-x1
        x3 = x1
        y3 = 2*y2-y1
        while x3 > x1
          cnt += 1 if a[x3][y3] > 0
          x3 -= 1
          y3 -= 1
        end

    elsif x1 > x2 # must be y1<y2
      next if x1-x2 <= y2-y1 || (x1+x2+y1+y2)%2 > 0
      x3 = (x1+x2-y1+y2)/2
      y3 = (x1-x2-y1+3*y2)/2
      cnt += 1 if a[x3][y3] > 0

    elsif x1 < x2 # must be y1<y2
      next if x2-x1 <= y2-y1 || (x1+x2+y1+y2)%2 > 0
      x3 = (x1+x2-y1+y2)/2
      y3 = (x1-x2-y1+3*y2)/2
      cnt += 1 if a[x3][y3] > 0
    end
  }
}

#print "ans:#{ans}\n"
print cnt
