#include "iostream"
using namespace std;

int main(){
	int b, c;
	
	cin >> b >> c;
	
	int res = 256-b-c;
	
	int razlika = b-c;
	
	cout << (256 - b*(1 + (razlika >> 31)) - c*(1 + ((-razlika) >> 31)))*(1 + (res >> 31));
		
	return 0;
}