#include <iostream>

using namespace std;





int main()
{
 int b, c, a,max;
            cin >> b >> c;
            while(b<0||b>500)
            {
              cin>>b;
            }
            while (c < 0 || c > 500)
            {
                cin>>c;
            }

            if (b == c)
            {
                max = b;
            }
            else if (b > c)
            {
                max = b;
            }
            else
            {
                max = c;
            }
            if(b>=256||c>=256||b+c>=256)
            {
                a = 0;
            }
            else
            {
                a = 256 - max;
            }
            cout<<""<<a;
}