#include <iostream>

using namespace std;

int main()
{
    int B,C;
    cin>>B;
    cin>>C;
    if(B+C>=256)
        cout<<0;
    else if (C==0)
        cout<<256-B;
    else if (B==0)
        cout<<256-C;
    else
        cout<<256-max(B,C);
    return 0;
}