program MinimalanTrud;

{$mode objfpc}{$H+}

uses
  {$IFDEF UNIX}{$IFDEF UseCThreads}
  cthreads,
  {$ENDIF}{$ENDIF}
  Classes
  { you can add units after this };
  var A, B, C: integer;
begin
  read(B);
  read(C);
  if B+C>=256 then A:=0
  else
    begin
      if B>C then A:=256-B
      else A:=256-C;
    end;
  write(A);
end.