#include <iostream>

using namespace std;

int main()

{
    int A,B,C;
    cin>>B>>C;
    if (256<=(B+C)) A=0;
    if ((B+C)<256 and C<B) A=256-B;
    if ((B+C)<256 and B<C) A=256-C;
    if (B=0 and 0<C and C<256) A=256-C;
    if (C=0 and 0<B and B<256) A=256-B;
    if (256<=B || 256<=C) A=0;
    cout<<A;
    return 0;
}