#include <iostream>

using namespace std;

int main()
{
    int B, C, calculate_bods, require_bods = 256;
    cin >> B >> C;

    if (B <= 500 && C <= 500 && B >= 0 && C >= 0)
    {
        if (B + C >= 256)
        {
            calculate_bods = 0;
            cout << calculate_bods << endl;
        } else
        {
            if (B > C)
            {
                calculate_bods = require_bods - B;
                cout << calculate_bods << endl;
            } else
            {
                calculate_bods = require_bods - C;
                cout << calculate_bods << endl;
            }
        }
    }

    return 0;
}