#include <bits/stdc++.h>
using namespace std;
const int MAX_N = 100;
int n, x, y, z, a[MAX_N] = {}, b[MAX_N] = {}, c[MAX_N] = {}, list[MAX_N] = {};
int main() {
  cin >> n;
  cin >> x;
  for (int i = 0; i < x; i++) {
    cin >> a[i];
  }
  cin >> y;
  for (int i = 0; i < y; i++) {
    cin >> b[i];
  }
  cin >> z;
  for (int i = 0; i < z; i++) {
    cin >> c[i];
  }
  sort(a, a + x);
  sort(b, b + x);
  sort(c, c + x);
  int ma = max(x, max(y, z));
  for (int i = 0; i < ma; i++) {
    for (int j = 0; j < ma; j++) {
      for (int k = 0; k < ma; k++) {
        if (a[i] == b[j] && b[j] == c[k] && a[i] != 0 && b[j] != 0 && c[k] != 0)
          list[a[i]] = 7;
        else if (b[j] == c[k] && a[i] != 0 && b[j] != 0 && c[k] != 0)
          list[b[j]] = 6;
        else if (a[i] == c[k] && a[i] != 0 && b[j] != 0 && c[k] != 0)
          list[a[i]] = 5;
        else if (a[i] == b[j] && a[i] != 0 && b[j] != 0 && c[k] != 0)
          list[a[i]] = 4;
        else if (c[k] != 0)
          list[c[k]] = 3;
        else if (b[j] != 0)
          list[b[j]] = 2;
        else if (a[i] != 0)
          list[a[i]] = 1;
      }
    }
  }
  int s = 0;
  for (int i = 0; i < n; i++) {
    if (list[i] == 3 || list[i] == 6 || list[i] == 7) {
      s++;
    }
  }
  cout << s << endl;
  return 0;
}
