#include <bits/stdc++.h>
#define sp ' '
#define nyan "(=^・ω・^=)"
#define mkp make_pair
#define lP pair<ll,ll>
#define iP pair<int,int>

typedef long long ll;
using namespace std;
const int mod = 1e9 + 7;

int N, M, A[100000], B[100000];
ll sa, sb;
int main(){
	cin >> N >> M;
	for (int i = 0; i != N; ++i) {
		cin >> A[i];
		sa += A[i];
	}
	for (int i = 0; i != M; ++i) {
		cin >> B[i];
		sb += B[i];
	}
	cout << sa * sb << endl;
	return 0;
}

