var
n,m,i,j,k,l,total:longint;
s:array[0..1000]of string;
function yes(a,b,c,d:longint):boolean;
var
i,j:longint;
begin
for i:=a to c do
for j:=b to d do
if s[i,j]='*' then exit(false);
exit(true);
end;
begin
assign(input,'rectangle.in'); reset(input);
assign(output,'rectangle.out'); rewrite(output);
readln(n,m);
for i:=1 to n do readln(s[i]);
for i:=1 to n do
for j:=1 to m do
for k:=i to n do
for l:=j to m do
if yes(i,j,k,l) then inc(total);
writeln(total);
close(input);
close(output);
end.