#include <bits/stdc++.h>
using namespace std;

int main()
{
    int b, c;
    cin >> b >> c;
    if (b + c >= 256) cout << 0 << "\n";
    else {
        int r = 256 - b - c;
        cout << min(256 - c, 256 - b) << "\n";
    }
    return 0;
}