program faktor;
var ifaktor,citat,i,brojc:longint;
begin
     readln(brojc,ifaktor);
     brojc:=(ifaktor-1)*brojc+1;
     write(brojc);
end.