#include <bits/stdc++.h>
using namespace std;
int main() {
  int loop = 0;
  int temp = 0;
  int mloop = 0;
  int sloop = 0;
  int achk = 0;
  int ans = 0;
  int N;
  cin >> N;
  int X;
  cin >> X;
  int a[100];
  for (loop = 0; loop < X; loop++) {
    cin >> a[loop];
  }
  loop = 0;
  int Y;
  cin >> Y;
  int b[100];
  for (loop = 0; loop < Y; loop++) {
    cin >> b[loop];
  }
  loop = 0;
  int Z;
  cin >> Z;
  int c[100];
  for (loop = 0; loop < Z; loop++) {
    cin >> c[loop];
  }
  loop = 0;
  for (loop = 0; loop < X - 1; loop++) {
    mloop = 0;
    for (mloop = 0; mloop < X - 1; mloop++) {
      if (a[mloop] > a[mloop + 1]) {
        temp = a[mloop];
        a[mloop] = a[mloop + 1];
        a[mloop + 1] = temp;
      }
    }
  }
  loop = 0;
  for (loop = 0; loop < Y - 1; loop++) {
    mloop = 0;
    for (mloop = 0; mloop < Y - 1; mloop++) {
      if (b[mloop] > b[mloop + 1]) {
        temp = b[mloop];
        b[mloop] = b[mloop + 1];
        b[mloop + 1] = temp;
      }
    }
  }
  loop = 0;
  for (loop = 0; loop < Z - 1; loop++) {
    mloop = 0;
    for (mloop = 0; mloop < Z - 1; mloop++) {
      if (c[mloop] > c[mloop + 1]) {
        temp = c[mloop];
        c[mloop] = c[mloop + 1];
        c[mloop + 1] = temp;
      }
    }
  }
  loop = 0;
  for (loop = 0; loop < Z; loop++) {
    mloop = 0;
    for (mloop = 0; mloop < Y; mloop++) {
      if (c[loop] == b[mloop]) {
        ans++;
      }
    }
  }
  loop = 0;
  for (loop = 0; loop < Z; loop++) {
    mloop = 0;
    for (mloop = 0; mloop < X; mloop++) {
      if (c[loop] == a[mloop]) {
        break;
      }
    }
    if (c[loop] == a[mloop]) {
      continue;
    }
    sloop = 0;
    for (sloop = 0; sloop < Y; sloop++) {
      if (c[loop] == b[sloop]) {
        break;
      }
    }
    if (c[loop] == b[sloop]) {
      continue;
    }
    ans++;
  }
  cout << ans << endl;
}
