import java.util.Scanner;


public class Trud {
    public static void main(String[] args){

        int A,B,C;
        Scanner scan = new Scanner(System.in);
        B=scan.nextInt();
        C=scan.nextInt();
        if(B+C>=256)A=0;
        else if(B+C<=256&&B>C){
            A=256-B;
        }
        else if(B+C<=256&&B<C){
            A=256-C;
        }
        else A=0;
        System.out.println(A);



    }
}