#include <iostream>

using namespace std;
int mini(int a,int b)
{
    if(a<=b) return a;
    else return b;
}
int main()
{
    int b,c,a1,a2;
    cin>>b>>c;
    if(b+c>=256) cout<<0<<endl;
    else
    {
        a1=256-b;
        a2=256-c;
        cout<<mini(a1,a2)<<endl;
    }
    return 0;
}