Option Strict On
Module Module1

    Sub Main()
        Dim n As Long = Convert.ToInt64(Console.ReadLine())
        Dim m(5) As Long
        m(5) = Convert.ToInt64(Console.ReadLine())
        m(4) = Convert.ToInt64(Console.ReadLine())
        m(3) = Convert.ToInt64(Console.ReadLine())
        m(2) = Convert.ToInt64(Console.ReadLine())
        m(1) = Convert.ToInt64(Console.ReadLine())
        Dim botlle As Long = m(1)
        Dim botllehai As Integer = 1
        For i As Integer = 2 To 5
            If m(i) < botlle Then
                botlle = m(i)
                botllehai = i
            End If
        Next
        Dim time As Long = 0
        time += n \ botlle + 5
            If m(5) >= n Then
            time -= 1
            If m(4) >= n Then
                time -= 1

                If m(3) >= n Then
                    time -= 1
                    If m(2) >= n Then
                        time -= 1
                        If m(1) >= n Then
                            time -= 1
                        End If
                    End If

                End If
            End If

        End If
        Console.WriteLine(time)
        Console.ReadLine()
    End Sub

End Module
