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.InputStreamReader;
import java.io.IOException;
import java.util.Arrays;
import java.util.InputMismatchException;
import java.io.BufferedReader;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
	public static void main(String[] args) {
		InputStream inputStream = System.in;
		OutputStream outputStream = System.out;
		QuickScanner in = new QuickScanner(inputStream);
		PrintWriter out = new PrintWriter(outputStream);
		TaskE solver = new TaskE();
		solver.solve(1, in, out);
		out.close();
	}
}

class TaskE {
    public void solve(int testNumber, QuickScanner in, PrintWriter out) {
        int n=in.nextInt();
        int m=in.nextInt();
        char buf[][]=new char[n][];
        for(int i=0;i<n;i++)
            buf[i]=in.next().toCharArray();
        int maxRight[][]=new int[n][m];
        int maxUpRight[][]=new int[n][m];
        int maxLeft[][]=new int[n][m];

        for(int i=0;i<n;i++)
        {
            if(buf[i][m-1]=='z')
            {
                maxRight[i][m - 1] = 1;
                maxUpRight[i][m-1] = 1;
            }
            else
            {
                maxRight[i][m - 1] = 0;
                maxUpRight[i][m-1]=1;
            }
        }

        for(int i=0;i<n;i++)
            maxLeft[i][0]=(buf[i][0]=='z')?1:0;
        for(int j=0;j<m;j++)
            maxUpRight[0][j]=(buf[0][j]=='z')?1:0;

        for(int j=m-2;j>=0;j--)
            for(int i=0;i<n;i++)
                if(buf[i][j]=='z')
                    maxRight[i][j] = maxRight[i][j + 1] + 1;
                else
                    maxRight[i][j]=0;

        for(int j=1;j<m;j++)
            for(int i=0;i<n;i++)
                maxLeft[i][j]=(buf[i][j]=='z')?maxLeft[i][j-1]+1:0;

        for(int j=m-2;j>=0;j--)
            for(int i=1;i<n;i++)
                maxUpRight[i][j]=(buf[i][j]=='z')?maxUpRight[i-1][j+1]+1:0;

        int usefulness[]=new int[n];
        Pair<Integer,Integer> ev[]=new Pair[n];
        for(int i=0;i<n;i++)
            ev[i]=new Pair<Integer, Integer>(0,0);

        SegmentTree tree=new SegmentTree(n, new IntegerMerger()
        {
            public int merge(int a, int b)
            {
                return a+b;
            }
        }, 0);

        long res=0;
        for(int diag=0;diag<n+m-1;diag++)
        {

            for(int i=0;i<n;i++)
            {
                int j=diag-i;
                if(j<0 || j>=m)
                    usefulness[i]=0;
                else
                    usefulness[i]=maxLeft[i][j];
            }
            for(int i=0;i<n;i++)
            {
                ev[i].first=i+usefulness[i];
                ev[i].second=i;
            }
            Arrays.sort(ev);
            for(int i=0;i<n;i++)
                tree.update(i,1);

            int evTop=0;
            for(int i=0;i<n;i++)
            {
                int j=diag-i;
                while(evTop<ev.length && ev[evTop].first<=i)
                    tree.update(ev[evTop++].second,0);
                if(0<=j && j<m)
                {
                    int maxUp = Math.min(maxRight[i][j],maxUpRight[i][j]);
                    res+=tree.getF(i-maxUp+1,i);
                }
            }
        }
        out.println(res);
    }
}

class QuickScanner {
    BufferedReader in;
    StringTokenizer token;
    String delim;
    public QuickScanner(InputStream inputStream)
    {
        this.in=new BufferedReader(new InputStreamReader(inputStream));
        this.delim=" \n\t";
        this.token=new StringTokenizer("",delim);
    }

    public boolean hasNext()
    {
        while(!token.hasMoreTokens())
        {
            try {
                String s=in.readLine();
                if(s==null) return false;
                token=new StringTokenizer(s,delim);
            } catch (IOException e) {
                throw new InputMismatchException();
            }
        }
        return true;
    }

    public String next()
    {
        hasNext();
        return token.nextToken();
    }

    public int nextInt()
    {
        return Integer.parseInt(next());
    }

}

class Pair<T1 extends Comparable<T1>, T2 extends Comparable<T2> > implements Comparable<Pair<T1,T2> >
{
	public T1 first;
	public T2 second;
	public Pair(T1 first,T2 second)
	{
		this.first=first;
		this.second=second;
	}

	public int compareTo(Pair<T1, T2> pr)
	{
		int v=this.first.compareTo(pr.first);
		if(v==0)
			return this.second.compareTo(pr.second);
		else
			return v;
	}
}

class SegmentTree
{
	int ds;
	int n;
	int tree[];
	int zero;
	IntegerMerger merger;

    public SegmentTree(int n, IntegerMerger merger, int zero)
	{
		this.n=n;
		ds=getDS(n);
		tree=new int[2*ds];
		for(int i=0;i<ds;i++)
			tree[i+ds]=zero;
		this.merger=merger;
		this.zero=zero;
		for(int i=ds-1;i>0;i--)
			tree[i]=this.merger.merge(tree[2*i],tree[2*i+1]);
	}
	int getDS(int n)
	{
		n--;
		n|=n>>1;
		n|=n>>2;
		n|=n>>4;
		n|=n>>8;
		n|=n>>16;
		return n+1;
	}
	public void update(int i, int val)
	{
		i+=ds;
		tree[i]=val;
		i>>=1;
		while(i>0)
		{
			tree[i]=merger.merge(tree[2*i],tree[2*i+1]);
			i>>=1;
		}
	}
	public int getF(int l, int r)
	{
		l+=ds;
		r+=ds;
		int lRes=zero;
		int rRes=zero;
		while(l<=r)
		{
			if((l&1)!=0) lRes=merger.merge(lRes,tree[l++]);
			if((r&1)==0) rRes=merger.merge(tree[r--],rRes);
			l>>=1;
			r>>=1;
		}
		return merger.merge(lRes,rRes);
	}
}

interface IntegerMerger
{
	int merge(int a, int b);
}

