#include <iostream>

using namespace std;

int main()
{
    int B,C,eredmeny,A;
    cin>>B>>C;
    if (B+C<256 && B<C)
        {
        eredmeny=256-(B+C);
        eredmeny=B+eredmeny;
        cout<<eredmeny<<endl;
    }
    else if (B+C<256 && C<B)
         {
        eredmeny=256-(B+C);
        eredmeny=C+eredmeny;
        cout<<eredmeny<<endl;
     }
    else
         {
        A=0;
        cout<<A<<endl;
         }


    return 0;
}