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

procedure Solve is
   R : Integer;
   G : Integer;
begin
   Get (R);
   Get (G);
   Put_Line (Integer'Image (G*2-R));
end Solve;