#include <iostream>
using namespace std;
int main()
{
    int B,C;
    cin >> B;
    cin >> C;
    if(B>=256 || C>=256)
        cout << 0;
    else if(B+C>=256)
        cout << 0;
    else if(B==C)
        cout << 256-B;
    else
        cout << 256-max(B,C);
    return 0;
}