#include <iostream>

using namespace std;


int main()
{
    // Variables
    int
        B,
        C,
        __calcPoints,
        __reqPoints = 256;
        
    
    std::cin >> B >> C;


    if ((B <= 500 && C <= 500) && (B >= 0 && C >= 0))
    {
        if (B + C >= 256)
        {
            __calcPoints = 0;
            std::cout << __calcPoints << std::endl;
        }
        
        else
        {
            if (B > C)
            {
                __calcPoints = (__reqPoints - B);
                std::cout << __calcPoints << std::endl;
            }
            
            else
            {
                __calcPoints = (__reqPoints - C);
                std::cout << __calcPoints << std::endl;
            }
        }
    }

    return 0;
}