#include <iostream>
#include <algorithm>
#include <string>
#include <cstring>
#include <vector>
#include <cstdio>
#include <cmath>
#include <set>
#include <utility>
#include <tuple>
#include <queue>

using namespace std;

int main()
{
    int n, m, a[100010], b[100010];
    long long ans=0, cnt=0;
    cin>>n>>m;
    for (int i=1; i<=n; i++) cin>>a[i];
    for (int j=1; j<=m; j++) { cin>>b[j]; cnt+=b[j]; }
    for (int i=1; i<=n; i++)
    {
        ans+=a[i]*cnt;
    }
    cout<<ans<<endl;
    return 0;
}

