#include <stdio.h>
#define MIN(a,b) (((a)<(b))?(a):(b))
#define MAX(a,b) (((a)>(b))?(a):(b))

int main()
{
    int a, b, c, max;
    scanf("%d%d", &b, &c);
    max = MAX(b,c);
    if (b + c >= 256)
        a = 0;
    else a = 256 - max;
    printf("%d", a);
    return 0;
}