#include <bits/stdc++.h>
using namespace std;
int H, W;
char ch[333][333], tmp[333][333];
int Sm[777][777];
int getv(int a1, int b1, int a2, int b2, bool b) {
  int l = max(a2 + b2 - H, b1), r = min(W, b2);
  return Sm[a2 + b2][r] - Sm[a2 + b2][l - 1] -
         b * 2 * (b2 <= W && ch[a2][b2] == '.');
}
long long Solve(bool b) {
  for (int i = 2; i <= H + W; i++)
    for (int j = max(1, i - H); j <= min(i, W); j++)
      Sm[i][j] = Sm[i][j - 1] + (ch[i - j][j] == '.');
  long long ans = 0;
  for (int i = 2; i <= H + W; i++)
    for (int j = max(1, i - H); j <= min(i, W); j++)
      if (ch[i - j][j] == '.')
        for (int k = j + 1; k <= min(i, W); k++)
          if (ch[i - k][k] == '.') ans += getv(i - k, k, i - j, k * 2 - j, b);
  return ans;
}
int main() {
  scanf("%d%d", &H, &W);
  for (int i = 1; i <= H; i++) scanf("%s", ch[i] + 1);
  long long ans = 0;
  for (int T = 0; T < 2; T++) {
    ans += Solve(0);
    for (int i = 1; i <= H; i++)
      for (int j = 1, k = W; j < k; j++, k--) swap(ch[i][j], ch[i][k]);
    ans += Solve(1);
    for (int i = 1, j = H; i < j; i++, j--)
      for (int k = 1; k <= W; k++) swap(ch[i][k], ch[j][k]);
    ans += Solve(0);
    for (int i = 1; i <= H; i++)
      for (int j = 1, k = W; j < k; j++, k--) swap(ch[i][j], ch[i][k]);
    ans += Solve(1);
    for (int i = 1, j = H; i < j; i++, j--)
      for (int k = 1; k <= W; k++) swap(ch[i][k], ch[j][k]);
    for (int j = 1; j <= H; j++)
      for (int k = 1; k <= W; k++) tmp[k][H - j + 1] = ch[j][k];
    swap(H, W);
    memset(ch, '#', sizeof ch);
    for (int j = 1; j <= H; j++)
      for (int k = 1; k <= W; k++) ch[j][k] = tmp[j][k];
  }
  printf("%lld\n", ans / 2);
  return 0;
}
