h,w = gets.split.map(&:to_i)
s = h.times.map{gets.chomp.chars.map{|c|c==?#}}

a = (h+w+1).times.map{Array.new(h+w+1)}
h.times{|i|
  w.times{|j|
    a[1+(i+j)][w+(i-j)] = 1 if s[i][j]
  }
}

hs = (h+w+1).times.map{Array.new(h+w+1, 0)}
vs = (h+w+1).times.map{Array.new(h+w+1, 0)}

1.upto(h+w){|i|
  1.upto(h+w){|j|
    hs[i][j] += a[i][j].to_i + hs[i][j-1]
    vs[i][j] += a[i][j].to_i + vs[i-1][j]
  }
}

#
cnt = 0
(h+w).times{|i|
  (h+w).times{|j|
    (j+1).upto(h+w-1){|k|
      d = k-j
      if a[i][j] && a[i][k]
        if 0 <= i-d
          cnt += hs[i-d][k] - hs[i-d][j-1]
          cnt -= a[i-d][j].to_i + a[i-d][k].to_i
        end
        if i+d <= h+w
          cnt += hs[i+d][k] - hs[i+d][j-1]
          cnt -= a[i+d][j].to_i + a[i+d][k].to_i
        end
      end
      if a[j][i] && a[k][i]
        if 0 <= i-d
          cnt += vs[k][i-d] - vs[j-1][i-d]
        end
        if i+d <= h+w
          cnt += vs[k][i+d] - vs[j-1][i+d]
        end
      end
    }
  }
}

p cnt
