#include <iostream>
using namespace std;

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