#include <bits/stdc++.h>

using uint = unsigned int;

auto main() -> int {
	uint a, b, c;
	constexpr uint potrebni_poeni = 256;

	std::scanf("%u%u", &b, &c);

	if (b + c >= potrebni_poeni) {
		std::printf("0\n");
		return 0;
	}

	auto bolji_krug = std::max(b, c);

	a = potrebni_poeni - bolji_krug;

	std::printf("%u\n", a);

}