program rectangle;
var
i,j,k,l,o,p,q,r,s,t:longint;
a:array[1..1000,1..1000]of char;
n,m:longint;
b:boolean;
max:longint;
begin
assign(input,'rectangle.in');
reset(input);
assign(output,'rectangle.out');
rewrite(output);
readln(n,m);
for i:=1 to n do
begin
for j:=1 to m do
read(a[i,j]);
readln;
end;
max:=0;
for i:=1 to n do
for j:=i to n do
for k:=1 to m do
for l:=k to m do
begin
b:=true;
for o:=i to j do
for p:=k to l do
if a[o,p]<>'.' then
begin
b:=false;
break;
end;
if b then inc(max);
end;
writeln(max);
close(input);
close(output);
end.