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

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