#include <bits/stdc++.h>
using namespace std;
namespace whatever {
int readu() {
  char ch = getchar();
  while (!isdigit(ch)) ch = getchar();
  int value = ch - '0';
  ch = getchar();
  while (isdigit(ch)) {
    value = value * 10 + ch - '0';
    ch = getchar();
  }
  return value;
}
void writeu(int n) {
  if (n < 10)
    putchar(n + '0');
  else {
    writeu(n / 10);
    putchar(n % 10 + '0');
  }
}
void run() {
  cerr << "time(0): " << time(0) << endl;
  int h = readu();
  int w = readu();
  static char s[300][301];
  for (int i = 0; i < h; ++i) {
    gets(s[i]);
    assert(int(strlen(s[i])) == w);
  }
  int result = 0;
  for (int i = 0; i < h; ++i)
    for (int j = 0; j < w; ++j)
      if (s[i][j] == '#')
        for (int k = 1; k < min(h - i, w - j); ++k)
          if (s[i + k][j + k] == '#')
            for (int a = 0; a <= k; ++a) {
              if (i - k + a >= 0 && j + k + a < w &&
                  s[i - k + a][j + k + a] == '#') {
                ++result;
              }
              if (i + k + a < h && j - k + a >= 0 &&
                  s[i + k + a][j - k + a] == '#') {
                ++result;
              }
            }
  cerr << "result: " << result << endl;
  for (int i = 0; i < h; ++i) reverse(s[i], s[i] + w);
  for (int i = 0; i < h; ++i)
    for (int j = 0; j < w; ++j)
      if (s[i][j] == '#')
        for (int k = 1; k < min(h - i, w - j); ++k)
          if (s[i + k][j + k] == '#')
            for (int a = 1; a < k; ++a) {
              if (i - k + a >= 0 && j + k + a < w &&
                  s[i - k + a][j + k + a] == '#')
                ++result;
              if (i + k + a < h && j - k + a >= 0 &&
                  s[i + k + a][j - k + a] == '#')
                ++result;
            }
  writeu(result);
  putchar('\n');
}
}  // namespace whatever
int main() { whatever::run(); }
