#include <iostream>
using namespace std;
int main(){
int n, m, i, v1[100],v2[100],s=0;
cin>>n>>m;
for(i=0;i<n;i++) cin>>v1[i];
for(i=0;i<m;i++) cin>>v2[i];
///După ce le-am citit, calculăm sumele
for(i=0;i<n;i++)s=s+v1[i];
for(i=0;i<m;i++)s=s+v2[i];
cout<<s;
}