#include <iostream>

using namespace std;

int main()
{
    int b, c, a;
    cin >> b >> c;
    a = 256 - (b + c);
    if(a > 0)
    {
        if(b > c)
        {
            a = 256 - b;
        }
        else
        {
            a = 256 - c;
        }
    }
    if(a < 0)
    {
        a = 0;
    }
    cout << a;
    return 0;
}