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

int c,b;

int main(){

  cin>>b>>c;

  int resenje;

  if(c>b ){resenje=256-c;}
  if(b==0 and c==0){resenje=256;}
  if(c<b ){resenje=256-b;};
  if(c>=256 or b==256){resenje=0;}
  if(c+b>=256){resenje=0;}

  cout<<resenje<<endl;

  return 0;
}