Imports System

Module Program
    Sub Main(args As String())
        Dim A As Integer = CInt(Console.ReadLine())
        Dim B As Integer = CInt(Console.ReadLine())

        Dim c As Integer = 6 - A - B

        Console.WriteLine(c)
    End Sub
End Module
