#include <iostream>

using namespace std;

int main()
{
    int drugiKrug, treciKrug, resenje1, resenje=0;

    cin>>drugiKrug>>treciKrug;

    if(drugiKrug>=treciKrug)
    {
        resenje1=256-drugiKrug;
    }
    else
    {
        resenje1=256-treciKrug;
    }

    if((drugiKrug+treciKrug)>=256)
        cout <<resenje<< endl;
    else
        cout <<resenje1<< endl;

    return 0;
}