#include <iostream>
#include <sstream>
#include <string>
#include <cstdlib>
#include <cmath>
using namespace std;

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