Program n_1;
var x, y, n, k:integer;
begin
read (x, y);
n:=x*y-y;
k:=x*y-x;
if(n<k) then k:=2*n+10
else k:=2*k+10;
writeln(k);
end.
Program n_1;
var x, y, n, k:integer;
begin
read (x, y);
n:=x*y-y;
k:=x*y-x;
if(n<k) then k:=2*n+10
else k:=2*k+10;
writeln(k);
end.