Module Module1

    Sub Main()

        Dim N As Integer = Console.ReadLine()
        Dim A As String() = Split(Console.ReadLine())
        Dim B As String() = Split(Console.ReadLine())
        Dim C As String() = Split(Console.ReadLine())
        Dim i As Integer
        Dim M As Integer = 0

        For i = 0 To N - 1
            M += Val(B(A(i) - 1))
            If i < (N - 1) AndAlso A(i) + 1 = A(i + 1) Then
                M += Val(C(A(i) - 1))
            End If
        Next

        Console.WriteLine(M)
        'Console.ReadLine()

    End Sub

End Module
