#include <bits/stdc++.h>
using namespace std;

#define FOR( i, m, n )   for( int i = m; i < n; i++ )
#define REP( i, n )      FOR( i, 0, n )
#define ALL( a )         (a).begin(), (a).end()

int main(){
  long long n, m, sum = 0, tmp = 0; cin >> n >> m;
  vector<int> a( n ), b( m );
  REP( i, n ){
    cin >> a[i];
    tmp += a[i];
  }
  
  REP( i, m ){
    cin >> b[i];
    sum += b[i] * tmp;
  }

  cout << sum << endl;
}

