Program Moduri;
var i,n,m,md : integer;
begin
writeln('Dati n:=');
readln(n);
writeln('Dati m:=');
readln(m);
if (n=1) and (m<=5) or (n=2) and (m=1) or (n=2) and (m=5) or (n=3) and (m=1) or (n=3) and (m=5) then
begin
md:=1;
end;
if (n=2) and (m=2) or (n=2) and (m=4) then
begin
md:=2;
end;
if (n=2) and (m=3) or (n=3) and (m=2) or (n=3) and (m=4) then
begin
md:=3;
end;
if (n=3) and (m=3) then
begin
md:=6;
end;
writeln('Pentru n=',n,' si m=',m,' exista ',md,' moduri:');
readln;
end.