with Ada.Text_IO; use Ada.Text_IO;
with Ada.Integer_Text_IO; use Ada.Integer_Text_IO;

procedure Solve is
   A : Integer;
   B : Integer;
begin
   Get (A);
   Get (B);
   if B*2 >= A then
      Put_Line ("0");
   else
      Put_Line (Integer'Image (A-B*2));
   end if;
end Solve;