import java.io._
import java.util.StringTokenizer
import scala.util.control.Breaks.{breakable,break}

object Main extends App {
  val in = new InputReader(System.in)
  val pw = new PrintWriter(System.out)

  val H, W = in.next().toInt
  val s = new Array[String](H)
  for (i <- 0 until H) {
    s(i) = in.next()
  }

  //
  def manhattan(p1: (Int, Int), p2: (Int, Int)): Int = {
    val (x1, y1) = p1
    val (x2, y2) = p2

    (x1 - x2).abs + (y1 - y2).abs
  }

  var pairs: List[(Int, Int)] = Nil

  for(y <- 0 until H; x <- 0 until W) {
    if(s(y)(x) == '#') {
      pairs = (x+1, y+1) :: pairs
    }
  }

  var ans = 0

  val ar = pairs.toArray
  val l = ar.length
  for(i <- 0 until l-1) {
    for(k <- i+1 until l) {
      val dist = manhattan(ar(i), ar(k))
      for(m <- k+1 until l) {
        if(manhattan(ar(i), ar(m)) == dist && manhattan(ar(k), ar(m)) == dist)
          ans += 1
      }
    }
  }
  println(ans)
}


class InputReader(stream: InputStream) {
  private val reader = new BufferedReader(new InputStreamReader(stream))
  private var tokenizer: StringTokenizer = new StringTokenizer(reader.readLine())
  def next(): String = {
    while (!tokenizer.hasMoreTokens()) {
      tokenizer = new StringTokenizer(reader.readLine())
    }
    tokenizer.nextToken()
  }
}

