import java.lang.Math

val MOD: Int = 1000000000 + 7
val MODL: Long = MOD.toLong()

fun main(args: Array<String>)
{
    val a = read().toInt()
    val b = read().toInt()

    if (a*b == 6) println(1)
    else if (a*b == 3) println(2)
    else if (a*b == 2) println(3)
}

fun read(): String = readLine()!!
