#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, a[110], t, X, Y, Z, A = 0, B = 0, C = 0;
  for (int i = 0; i < 110; i++) a[i] = 1;
  cin >> N;
  cin >> X;
  for (int i = 0; i < X; i++) {
    cin >> t;
    a[t] *= 2;
  }
  cin >> Y;
  for (int i = 0; i < Y; i++) {
    cin >> t;
    a[t] *= 3;
  }
  cin >> Z;
  for (int i = 0; i < Z; i++) {
    cin >> t;
    a[t] *= 5;
  }
  for (int i = 0; i < N; i++) {
    if (a[i] % 5 == 0) A++;
    if (a[i] % 10 == 0) B++;
    if (a[i] % 30 == 0) C++;
  }
  cout << A - B + C << endl;
  return 0;
}
