#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, inp, str, str2, str3, d;
  int a[101] = {};
  int b[101] = {};
  int c[101] = {};
  inp = 0;
  cin >> n;
  for (int i = 0; i <= 101; i++) {
    a[i] = 0;
    b[i] = 0;
    c[i] = 0;
  }
  cin >> str;
  if (str != 0) {
    for (int i = 0; i < str; i++) {
      cin >> inp;
      a[inp] = 1;
    }
  }
  cin >> str2;
  if (str2 != 0) {
    for (int i = 0; i < str2; i++) {
      cin >> inp;
      b[inp] = 1;
    }
  }
  cin >> str3;
  if (str3 != 0) {
    for (int i = 0; i < str3; i++) {
      cin >> inp;
      c[inp] = 1;
    }
  }
  d = 0;
  for (int i = 0; i < str2; i++)
    for (int j = 0; j < str3; j++) {
      if (b[i] == c[j]) d++;
    }
  for (int k = 0; k < str3; k++)
    for (int j = 0; j < str2; j++)
      for (int i = 0; i < str; i++) {
        if (a[i] == 0 && b[j] == 0 && c[k] == 1) {
          d++;
          c[k] = 0;
        }
      }
  cout << d << endl;
}
