#include <stdio.h>
#include <math.h>

int main(void) {
	int B, C, A;
	scanf("%d", &B);
	scanf("%d", &C);
	if (B > C) {
		A = 256 - B;
	}
	if (B < C) {
		A = 256 - C;
	}
	if (A < 0) {
	A = fabs(A) + A;
	}
	printf("%d", A);
	return 0;
}