#include <bits/stdc++.h>

using namespace std;

int main()
{
    int n, m;
    cin>>n>>m;
    if(n+m>256 || n>256 || m>256) cout <<0<< endl;
    else cout << min(256-n, 256-m) << endl;
    return 0;
}