#include <bits/stdc++.h>

using namespace std;

int main()
{
   ios::sync_with_stdio(false);
   int b,c;
   cin >> b >> c;
   if(b+c<256) cout << min(256-b,256-c)<< '\n';
   else cout << 0 << '\n';
   return 0;
}