#include<bits/stdc++.h>
using namespace std;
int main()
{
    int a,b;
    cin >> a >> b;
    int c1=a-256, c2=b-256;
    if (a+b>=256)
    {
        cout << 0;
        return 0;
    }   
    cout << min(c1,c2);
    return 0;
}