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.*;
import java.util.*;

public class E implements Runnable {
	public static void main (String[] args) {new Thread(null, new E(), "_cf", 1 << 28).start();}
	
	public void run() {
		FastScanner fs = new FastScanner();
		PrintWriter out = new PrintWriter(System.out);
		System.err.println("Go!");

		int n = fs.nextInt();
		int m = fs.nextInt();
		char[][] g = new char[n][m];
		for(int i = 0; i < n; i++) g[i] = fs.next().toCharArray();
		int z = 0;
		for(char[] ch : g) for(char c : ch) if(c == 'z') z++;
		BIT[] bits = new BIT[n + m - 1];
		for(int i = 0; i < bits.length; i++) bits[i] = new BIT(n);
		
		int[][] left = new int[n][m], right = new int[n][m];
		int[][] down = new int[n][m];
		ArrayList<Point>[] list = new ArrayList[m];
		for(int i = 0; i < m; i++) list[i] = new ArrayList<>();
		
		for(int i = n-1; i >= 0; i--) {
			for(int j = m-1; j >= 0; j--) {
				if(g[i][j] != 'z') continue;
				right[i][j]++;
				down[i][j]++;
				if(j + 1 < m) right[i][j] += right[i][j+1];
				if(i + 1 < n && j-1 >= 0) down[i][j] += down[i+1][j-1];
				list[j + right[i][j] - 1].add(new Point(i, j));
			}
			for(int j = 0; j < m; j++) {
				if(g[i][j] != 'z') continue;
				left[i][j]++;
				if(j > 0) left[i][j] += left[i][j-1];
			}
		}

		long res = 0;
		for(int j = m-1; j >= 0; j--) {
			for(Point p : list[j]) {
				bits[p.x + p.y].update(p.x + 1, 1);
			}
			for(int i = 0; i < n; i++) if(g[i][j] == 'z') {
				int goFor = Math.min(left[i][j], down[i][j]) - 1;
				if(goFor <= 0) continue;
				int sum = bits[i + j].sum(i + goFor + 1);
				sum -= bits[i + j].sum(i + 1);
				res += sum;
			}
		}
		res += z;
		out.println(res);
		
		out.close();
	}
	
	class Point {
		int x, y;
		Point(int a, int b) {
			x = a; y = b;
		}
	}
	
	class BIT {
		int n, tree[];
		BIT(int a) {
			n = a;
			tree = new int[n + 1];
		}
		int sum(int i) {
			int res = 0;
			while(i > 0) {
				res += tree[i];
				i -= (i & (-i));
			}
			return res;
		}
		void update(int p, int v) {
			while(p <= n) {
				tree[p] += v;
				p += (p & (-p));
			}
		}
	}
	
	class FastScanner {
		public int BS = 1<<16;
		public char NC = (char)0;
		byte[] buf = new byte[BS];
		int bId = 0, size = 0;
		char c = NC;
		double num = 1;
		BufferedInputStream in;

		public FastScanner() {
			in = new BufferedInputStream(System.in, BS);
		}

		public FastScanner(String s) throws FileNotFoundException {
			in = new BufferedInputStream(new FileInputStream(new File(s)), BS);
		}

		public char nextChar(){
			while(bId==size) {
				try {
					size = in.read(buf);
				}catch(Exception e) {
					return NC;
				}                
				if(size==-1)return NC;
				bId=0;
			}
			return (char)buf[bId++];
		}

		public int nextInt() {
			return (int)nextLong();
		}

		public long nextLong() {
			num=1;
			boolean neg = false;
			if(c==NC)c=nextChar();
			for(;(c<'0' || c>'9'); c = nextChar()) {
				if(c=='-')neg=true;
			}
			long res = 0;
			for(; c>='0' && c <='9'; c=nextChar()) {
				res = (res<<3)+(res<<1)+c-'0';
				num*=10;
			}
			return neg?-res:res;
		}

		public double nextDouble() {
			double cur = nextLong();
			return c!='.' ? cur:cur+nextLong()/num;
		}

		public String next() {
			StringBuilder res = new StringBuilder();
			while(c<=32)c=nextChar();
			while(c>32) {
				res.append(c);
				c=nextChar();
			}
			return res.toString();
		}

		public String nextLine() {
			StringBuilder res = new StringBuilder();
			while(c<=32)c=nextChar();
			while(c!='\n') {
				res.append(c);
				c=nextChar();
			}
			return res.toString();
		}

		public boolean hasNext() {
			if(c>32)return true;
			while(true) {
				c=nextChar();
				if(c==NC)return false;
				else if(c>32)return true;
			}
		}
		
		public int[] nextIntArray(int n) {
			int[] res = new int[n];
			for(int i = 0; i < n; i++) res[i] = nextInt();
			return res;
		}
		
	}

	
}