const readline = require('readline').createInterface({
	  input: process.stdin,
	  output: process.stdout
})

readline.question('',(input1) => {
	readline.question('',(input2) => {
		console.log(6-Number(input1)-Number(input2))
		readline.close()
	});
});
