import java.util.Scanner;

public class MinTrud {

    public static void main(String[] args) {
        Scanner ul = new Scanner(System.in);
        int A = 0,B,C;
        B = ul.nextInt();
        C = ul.nextInt();
        if(B>= 256 || C >= 256)
        {
            A = 0;
        } else if( B + C >= 256){
            A = 0;
        } else{
            if(B >= C){
             A = 256 - B;   
            } else if( C > B){
                A = 256 - C;
            }
        }
        System.out.println(A);
    }
}