fun main(args: Array<String>) {
    val A = readLine()!!.toInt()
    val B = readLine()!!.toInt()
    val l = listOf(A, B).sorted()

    if (l[0] != 1) {
        println(1)
    } else if (l[1] != 3) {
        println(3)
    } else {
        println(2)
    }
}
