#include <bits/stdc++.h>
#define r(i,n) for(int i=0;i<n;i++)
#define int long long
using namespace std;
typedef pair<int,int>P;
#define fi first
#define se second


signed main(){
  int n,m;
  int A=0,B=0;
  cin>>n>>m;
  r(i,n){
    int a;
    cin>>a;
    A+=a;
  }
  r(i,m){
    int a;
    cin>>a;
    B+=a;
  }
  cout<<A*B<<endl;
}


