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

int prolaz(int b, int c){
    if (b>=256 || c>=256 || b+c>=256) return 0;
    else
        if (b>=c) return 256-b;
        else return 256-c;
}

int main()
{
    int b, c;
    scanf("%d %d", &b, &c);
    printf("%d", prolaz(b, c));
    return 0;
}