#include <iostream>
#include <algorithm>
using namespace std;

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