program project1;
   var
      a,b,c:integer;
begin
  Read(b);
  ReadLn(c);
  if (b+c > 256) then a:=0
  else
    begin
      if (b>c) then a:=256-b
      else a:=256-c;
    end;
  Write(a);
  ReadLn();
end.