import java.util.Scanner

fun main(args: Array<String>) {
    val scanner = Scanner(System.`in`)
    val sa = scanner.nextInt()
    val sb = scanner.nextInt()
    val a = (arrayOf(1, 2, 3).filter{ it != sa && it != sb })[0]
    println(a)
}