program Project2; {$APPTYPE CONSOLE} uses SysUtils; Var N,M,g,k,l:int64; begin assign(input,'problem.in'); reset(input); close(input); readln(N,M); assign(output,'problem.out'); rewrite(output); g:=N-1; if (N>0) then k:=2*g+1; l:=2*N div (M div 2)-1; writeln(l); readln; close(output); { TODO -oUser -cConsole Main : Insert code here } end.