import java.io.{BufferedReader, InputStreamReader}

object Main {
  def main(args: Array[String]): Unit = {
    val in = new BufferedReader(new InputStreamReader(System.in))
    val a = in.readLine()
    val b = in.readLine()

    System.out.println(
      (Set("1","2","3") - a - b).mkString("")
    )
  }
}
