#include <iostream>
#include <cstring>
using namespace std;

int main(void){
  int n, ans;
  char flg[101];
  
  cin >> n;
  memset(flg, 0, n+1);
  for (int i=0; i<3; i++){
    int m; cin >> m;
    for (int j=0; j<m; j++){
      int id; cin >> id;
      flg[id] |= 1<<i;
    }
  }
  ans = 0;
  for (int i=1; i<=n; i++){
//    cout << i << ":" << (int)flg[i] << endl;
    if (flg[i]==4 || flg[i]==6 || flg[i]==7){
      ans++;
    }
  }
  cout << ans << endl;
  return 0;
}
