72b228b99c6cc86ec38f7549346464d0adddbce7c823d8149c5d4b03ca33c78c
// https://szkopul.edu.pl/problemset/problem/isVbAEInYlrdxQNvE6mEnS9i/site/?key=statement
// II OIG (2 etap)
#include <algorithm>
#include <iostream>
#include <map>
#include <vector>
std::vector<long long> v1, v2, v3;
int main() {
std::ios_base::sync_with_stdio(0);
std::cin.tie(0);
std::cout.tie(0);
int b, k, z;
std::cin >> b >> k >> z;
int n1, n2, n3;
std::cin >> n1;
for (int i = 0; i < n1; i++) {
int a;
std::cin >> a;
v1.push_back((long long)a * b);
}
std::cin >> n2;
for (int i = 0; i < n2; i++) {
int a;
std::cin >> a;
v2.push_back((long long)a * k);
}
std::cin >> n3;
for (int i = 0; i < n3; i++) {
int a;
std::cin >> a;
v3.push_back((long long)a * z);
}
std::sort(v1.begin(), v1.end());
std::sort(v2.begin(), v2.end());
std::sort(v3.begin(), v3.end());
const auto &last1 = v1[v1.size() - 1], &last2 = v2[v2.size() - 1], &last3 = v3[v3.size() - 1];
long long szk = ((last1) / 2) + ((last2) / 2) + ((last3) / 2);
if (last1 % 2 == 1 && last2 % 2 == 1) {
szk++;
} else if (last2 % 2 == 1 && last3 % 2 == 1) {
szk++;
} else if (last1 % 2 == 1 && last3 % 2 == 1) {
szk++;
}
int ans = 0;
for (int i = v1.size() - 1; i >= 0; i--) {
for (int j = v2.size() - 1; j >= 0; j--) {
if (v3.size() < 2) {
if (v1[i] + v2[j] + v3[0] > szk) {
ans++;
}
continue;
}
int p = 0, k = v3.size() - 1, s = 0;
long long sum = v1[i] + v2[j];
while (p < k) {
s = (p + k) / 2;
if (v3[s] >= szk - sum + 1) {
k = s;
} else {
p = s + 1;
}
}
if (v1[i] + v2[j] + v3[p] > szk) {
ans += v3.size() - p;
}
}
}
std::cout << ans << '\n';
return 0;
}