#include <iostream>

using namespace std;

int MinimalanTrud(int B, int C)
{
    if(B>=256||C>=256||B+C>=256) return 0;
    if(B>C) return 256-B;
    else return 256-C;
}

int main()
{
    int B, C;
    cin >> B >> C;
    cout << MinimalanTrud(B, C);
    return 0;
}