#include <iostream>

using namespace std;

int main()
{
    int a, b, c, maks;

    cin>>b>>c;

    while(b<0 || b>500)
    {
        cin>>b;
    }
    while(c<0 || c>500)
    {
        cin>>c;
    }

    if (b + c >= 256)
            {
                a = 0;
                cout<<a;
            }

    if (b + c < 256)
            {
                if(b>c)
                {
                    maks = b;
                }
                else
                {
                    maks = c;
                }
                a = 256 - maks;
                cout<<a;
            }

    return 0;
}