Program ivan;
 var krug1,krug2,krug3,maksimum:integer;
 begin
  readln(krug2,krug3);
  if krug2+krug3>=256 then
 begin
  krug1:=0; writeln(krug1);
  end
  else
 begin
  if krug2>krug3 then maksimum:=krug2
  else maksimum:=krug3;
  krug1:=256-maksimum; writeln(krug1);
  end;
end.