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;
  writeln(a)
end.