fun main(args: Array<String>) {
  val A = readLine()!!.toInt()
  val B = readLine()!!.toInt()
  if (A != 1 && B != 1) {
    println(1)
  }
  if (A != 2 && B != 2) {
    println(2)
  }
  if (A != 3 && B != 3) {
    println(3)
  }
}
