#include <iostream>
#include <cmath>
#include <vector>
#include <algorithm>
#include <string>
#include <queue>
#include <functional>
#include <map>
using namespace std;

long long N, M, A[100009], B[100009], s1, s2;

int main() {
	cin >> N >> M;
	for (int i = 0; i < N; i++) { cin >> A[i]; s1 += A[i]; }
	for (int i = 0; i < M; i++) { cin >> B[i]; s2 += B[i]; }
	cout << s1 * s2 << endl;
	return 0;
}
