#include<bits/stdc++.h> using namespace std; int a[100001],b; long long s; int main(){ cin>>b; for(int i=1;i<=b; ++i){ cin>>a[i]; } for(int i=1;i<=b;i++){ for(int j=i+1;j<=b;j++){ s+=a[i]*a[j]; } } cout<<s; return 0; }