A tourist wants to visit country Zeydabad for Zbazi (a local game in Zeydabad).

The country Zeydabad is a rectangular table consisting of n rows and m columns. Each cell on the country is either 'z' or '.'.

The tourist knows this country is named Zeydabad because there are lots of ''Z-pattern"s in the country. A ''Z-pattern" is a square which anti-diagonal is completely filled with 'z' and its upper and lower rows are also completely filled with 'z'. All other cells of a square can be arbitrary.

<image>

Note that a ''Z-pattern" can consist of only one cell (see the examples).

So he wants to count the number of ''Z-pattern"s in the country (a necessary skill for Zbazi).

Now your task is to help tourist with counting number of ''Z-pattern"s.

As input/output can reach huge size it is recommended to use fast input/output methods: for example, prefer to use gets/scanf/printf instead of getline/cin/cout in C++, prefer to use BufferedReader/PrintWriter instead of Scanner/System.out in Java.

Input

The first line contains two integers n, m (1 ≤ n, m ≤ 3000) — the number of rows and columns respectively.

Each of the next n lines contains m characters 'z' or '.' — the description of Zeydabad.

Output

Print the only integer a — the number of ''Z-pattern"s in Zeydabad.

Examples

Input

4 4
zzzz
zzz.
.z..
zzzz


Output

16


Input

1 4
z.z.


Output

2


Input

2 2
zz
zz


Output

5
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.io.Reader;
import java.util.ArrayList;
import java.util.StringTokenizer;

// Educational Codeforces Round 8
// Zbazi in Zeydabad
public class Problem_628_E {
    

    public static void main(String[] args)
    {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        PrintWriter out = new PrintWriter(outputStream);
        Problem_628_E solver = new Problem_628_E();
        solver.solve(1, new InputStreamReader(inputStream), out);
        out.close();
    }
    
    static class Pair implements Comparable<Pair> {
      int first;

      int second;

      Pair(int f, int s)
      {
        first = f;
        second = s;
      }

      public int compareTo(Pair o)
      {
        int r = first - o.first;

        if(r == 0)
          r = second - o.second;

        return r;
      }
    }
    
    public class FenwickTree {
      int[] t;

      int n;

      public FenwickTree(int n)
      {
        this.n = n;
        t = new int[n];
      }

      public void add(int i, int value)
      {
        for(; i < n; i += (i + 1) & -(i + 1)) {
          t[i] += value;
        }
      }

      public int sum(int i)
      {
        int res = 0;
        for(; i >= 0; i -= (i + 1) & -(i + 1)) {
          res += t[i];
        }
        return res;
      }
    }

    public void solve(int test, Reader input, PrintWriter out)
    {
        MyScanner in = new MyScanner(input);
        
        int n = in.nextInt();
        int m = in.nextInt();
        
        char[][] matrix = new char[n][];
        
        for(int i = 0; i < n; i++)
          matrix[i] = in.next().toCharArray();
        
        int[][] dpl = new int[3001][3001];
        int[][] dpr = new int[3001][3001];
        int[][] dpld = new int[n+1][m+1];
        for(int i = n - 1; i >= 0; i--)
          for(int j = 0; j < m; j++) {
            if(matrix[i][j] == 'z') {
              dpl[i][j] = dpld[i][j] = 1;
              if(j > 0) dpl[i][j] += dpl[i][j-1];
              if(j > 0 && i + 1 < n) dpld[i][j] += dpld[i + 1][j - 1]; 
            }
          }
        
        for(int i = 0; i < n; i++) {
          for(int j = m - 1; j >= 0; j--) {
            if(matrix[i][j] == 'z') {
              dpr[i][j] = 1;
              if(j + 1 < m) dpr[i][j] += dpr[i][j + 1];
            }
          }
        }
        
        @SuppressWarnings("unchecked")
        ArrayList<Pair>[] events = new ArrayList[3001];
        for(int i = 0; i < 3001; i++)
          events[i] = new ArrayList<>();
        
        for(int i = 0; i < n; i++)
          for(int j = 0; j < m; j++)
            if(dpr[i][j] != 0) {
              events[j + dpr[i][j] - 1].add(new Pair(i, j));
            }
        
        FenwickTree[] t = new FenwickTree[6001];
        for(int i = 0; i < 6001; i++)
          t[i] = new FenwickTree(3001);
        
        long ans = 0;
        
        for(int j = m - 1; j >= 0; j--) {
          for(Pair event : events[j]) {
            t[event.first + event.second].add(event.second, 1);
          }
          for(int i = 0; i < n; i++) {
            int c = Math.min(dpl[i][j], dpld[i][j]);
            if(c == 0) continue;
            ans += t[i + j].sum(j) - t[i + j].sum(j - c);
          }
        }
        out.println(ans);
    }

    //-----------MyScanner class for faster input----------
    public static class MyScanner {
        BufferedReader br;
        StringTokenizer st;

        public MyScanner(Reader reader) {
            br = new BufferedReader(reader);
        }

        String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        int nextInt() {
            return Integer.parseInt(next());
        }
        
        int[] nextIntArray(int n)
        {
            int[] r = new int[n];
            for(int i = 0; i < n; i++)
                r[i] = nextInt();
            return r;
        }

        long nextLong() {
            return Long.parseLong(next());
        }

        double nextDouble() {
            return Double.parseDouble(next());
        }

        String nextLine(){
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }

    }
    //--------------------------------------------------------

}
