#include<iostream>
using namespace std;

int main(){
  long long x,y;
  long long c = 0;
  long long s = 0;
  cin >> x >> y;
  for(long long i=0; i<x; ++i){
    int tmp;
    cin >> tmp;
    c += tmp;
  }

  for(long long i=0; i<y; ++i){
    int tmp;
    cin >> tmp;
    s += tmp;
  }
  cout << c*s << endl;
}

