#include<iostream>
#include<algorithm>
#include<vector>
#include<queue>
#define lol(i,n) for(int i=0;i<n;i++)
#define mod 1000000007
typedef long long ll;

using namespace std;

int main(){
    ll sa=0,sb=0,a,b,n,m;
    cin>>n>>m;
    lol(i,n){
	cin>>a;
	sa+=a;
    }
    lol(i,m){
	cin>>b;
	sb+=b;
    }
    cout<<sa*sb<<endl;
    return 0;
}

