#include <iostream>
using namespace std;

int maximum(int a, int b)
{
    return a>b?a:b;
}

int main()
{
    int B,C,minimum=0;
    cin >> B >> C;
    while ((B<=500)&&(C<=500)&&(B>=0)&&(C>=0))
    {
        if (B+C<256)
        {
            minimum=256-maximum(B,C);
            cout << minimum << endl;
            break;
        }
        cout << minimum << endl;
        break;
    }
    return 0;
}