// parameter "input" gets all data
function Main(input) {
	input = input.split("\n").map(a => parseInt(a));
	console.log( 6-(input.reduce((a,b)=>a+b)) )
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));