Module Module1

    Sub Main()
        Console.WriteLine("作成する串焼きの個数を入力してください。")
        Dim number As String = Console.ReadLine()
        Dim N As Integer = CInt(number)

        Dim L(200) As Integer
        Console.WriteLine("串の長さを本数分入力してください。")
        For i As Integer = 0 To 2 * N - 1
            Console.Write(CStr(i + 1) + "本目の串の長さ ")
            L(i) = CInt(Console.ReadLine())
        Next

        Dim temp As Integer
        For i As Integer = 0 To 2 * N - 1
            For j As Integer = i + 1 To 2 * N - 1
                If L(i) > L(j) Then
                    temp = L(i)
                    L(i) = L(j)
                    L(j) = temp
                End If
            Next
        Next

        Dim sum As Integer = 0
        For i As Integer = 0 To 2 * N - 1 Step 2
            sum = sum + L(i)
        Next

        Console.WriteLine(CStr(N) + "個の串焼きに刺すことのできる具材の数は、" + CStr(sum) + "個です。")
    End Sub

End Module
