/*  -*- coding: utf-8 -*-
 *
 * 2922.cc: Mercy
 */

#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<iostream>
#include<string>
#include<vector>
#include<map>
#include<set>
#include<stack>
#include<list>
#include<queue>
#include<deque>
#include<algorithm>
#include<numeric>
#include<utility>
#include<complex>
#include<functional>
 
using namespace std;

/* constant */

/* typedef */

typedef long long ll;

/* global variables */

/* subroutines */

/* main */

int main() {
  int n, m;
  scanf("%d%d", &n, &m);

  int asum = 0, bsum = 0;
  for (int i = 0; i < n; i++) {
    int ai;
    scanf("%d", &ai);
    asum += ai;
  }
  for (int i = 0; i < m; i++) {
    int bi;
    scanf("%d", &bi);
    bsum += bi;
  }

  printf("%lld\n", (ll)asum * bsum);
  return 0;
}

