module module1
sub main()
    dim number as string
    dim takoyaki as string
    number = console.readline()
    takoyaki = console.readline()
    dim a as string()
    a = split(takoyaki)
    dim b as string
    dim c as string
    c = number * (number - 1) / 2
    dim i as integer
    dim n as integer
    dim d as integer
    for i = 0 to c - 1
        for n = i + 1 to c - 1
            b = b + a(i) * a(n)
        next
        d = d + b
    next
    console.writeline(d)
End sub
end module