#include <iostream>

using namespace std;

int main()
{
    int a = 0;
    int b = 0;
    int c = 0;

    cin >> b >> c;

    if(b+c > 255)
    {
        a = 0;
    }

    else if(b > c)
    {
        a = 256 - b;
    }

    else
    {
        a = 256 - c;
    }

    cout << a;

    return 0;
}