Module Module1

    Sub Main()
        Dim instr() As String = Split(Console.ReadLine())
        Dim n As Integer = CInt(instr(0))
        Dim m As Integer = CInt(instr(1))
        Dim a As Integer = -1

        For i As Integer = n To CInt(m / 2)
            If m Mod i = 0 Then
                a = i
                Exit For
            End If
        Next
        If a <> -1 Then
            Console.WriteLine(m / a)
        Else
            Console.WriteLine(1)
        End If
    End Sub

End Module
