#include <iostream>

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