fun main (args : Array<String>) {
	val a = readLine()!!
	val b = readLine()!!
	var result : Int = 0
	for (i in 1..3) {
		if (i != a.toInt() && i != b.toInt()) {
			result = i
			break
		} else {
			continue
		}
	}
	return println("${result}")
}