#include <iostream>
#include <cmath>

using namespace std;

int main()
{
    int b,c;

    cin >> b >> c;

    int a = min(256-b, 256-c);

    if((a < 0) || (b + c >= 256)) a = 0;

    cout << a << endl;
    return 0;
}