Option Strict On
Module Module1

    Sub Main()
        Dim menu(4) As Integer
        For i As Integer = 0 To 4
            menu(i) = Convert.ToInt32(Console.ReadLine())
        Next
        Dim time As Integer = 0
        Dim counter As Integer = 0
        Dim furagu As Integer = 1
        For i As Integer = 0 To 4
            time += (menu(i) \ 10) * 10
            menu(i) = (menu(i) - (menu(i) \ 10) * 10)
            If menu(i) <> 0 Then
                counter += 1
                furagu = 1
            End If
        Next
        time += (counter - 1) * 10
        'Console.WriteLine(time)
        'Console.WriteLine(counter)
        ' For Each t In menu
        'Console.WriteLine(t)
        'Next
        If furagu = 0 Then
            Console.WriteLine(time)
            Console.ReadLine()
            Return
        End If
        Dim mini As Integer = 10
        For i As Integer = 0 To 4
            If menu(i) <> 0 And mini > menu(i) Then
                mini = menu(i)
            End If
        Next
        ' Console.WriteLine(mini)
        time += mini
        Console.WriteLine(time)
        Console.ReadLine()
    End Sub

End Module