func readInts() -> [Int] {
    return readLine()!.split(separator: " ").map { Int($0)! }
}

func main() {
    let a = Int(readLine()!)!
    let b = Int(readLine()!)!
    
    if a != 1 && b != 1 {
        print(1)
        return
    }
    if a != 2 && b != 2 {
        print(2)
        return
    }
    if a != 3 && b != 3 {
        print(3)
        return
    }
}

main()
