import java.util.Scanner;

public class MinimalanTrud {

    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);
        
        int B = sc.nextInt();
        int C = sc.nextInt();
        
        if (B + C >= 256) {
            System.out.println(0);
            return;
        }
        
        int A = (256 - B >= 256 - C) ? 256 - C : 256 - B;
        System.out.println(A);
        
    }
    
}