
#### 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"
}

##

ans = []
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
      x3 = x1
      y3 = y1
      x1 = x2
      y1 = y2
      x2 = x3
      y2 = y3
    end
    diff12 = (x2-x1).abs + (y2-y1).abs
    #print "i:#{i} j:#{j} x:#{x1} #{y1} #{x2} #{y2} diff:#{diff12}\n"
    (j+1).upto(nc-1) { |k|
      c3 = c[k]
      x3 = c3[0]
      y3 = c3[1]
      if diff12 == (x3-x1).abs + (y3-y1).abs &&
         diff12 == (x3-x2).abs + (y3-y2).abs 
        ans << [x1,y1,x2,y2,x3,y3]
      end
    }
  }
}

#print "ans:#{ans}\n"
print ans.size


