import core.atomic;
import std.algorithm;
import std.array;
import std.conv;
import std.parallelism;
import std.range;
import std.stdio;
import std.string;


uint parSolver(uint[] xs, uint[] ys) {
	shared uint res = 0;
	foreach (z; parallel(cartesianProduct(xs, ys))) {
		res.atomicOp!"^="(z[0] + z[1]);
	}
	return res;
}


void main() {
	auto n = readln.chomp.to!uint;
	auto xs = readln.split.map!(to!uint).array;
	auto ys = readln.split.map!(to!uint).array;
	auto res = parSolver(xs, ys);
	writeln(res);
}
