#include <iostream>

using namespace std;

int main()
{
    int b, c; cin >> b >> c;
    if (b + c > 255)
        cout << "0";
    if (256 - b >= 256 - c)
        cout << 256 - b;
    else
        cout << 256 - c;
}