#include <iostream>
#include <stdio.h>
#include <stdlib.h>

using namespace std;

int main()
{
    int b,c;
    scanf("%d",&b);
    scanf("%d",&c);
    if(b>255 || c>255) printf("0");
    else if(b>=c) printf("%d",256-b);
    else printf("%d",256-c);
}