program faktor; var c,i,s:integer; begin readln (c,i); s:=0; s:=c*i-c; if c mod i=0 then writeln (s) else write (s+1); end.