#include <iostream>
#include <queue>
#include <vector>
#include <utility>
using namespace std;
#define MAX 50
vector<vector<int>> v(MAX);
vector<int> know;
int parents[MAX];
int n, m, k;
int Find(int x) { return x = (parents[x] == x) ? x : Find(parents[x]); }
void Union(int x, int y) { parents[Find(x)] = Find(y); }
int main()
{
ios::sync_with_stdio(NULL);
cin.tie(nullptr);
cout.tie(NULL);
cin >> n >> m >> k;
// 배열 초기화
while (k--)
{
int t; cin >> t;
know.push_back(t);
}
for (int i = 0; i <= n; i++)
parents[i] = i;
for (int i = 0; i < m; i++)
{
int p; cin >> p;
int num, prev;
for (int j = 0; j < p; j++)
{
if (j >= 1)
{
prev = num;
cin >> num;
Union(prev, num);
}
else
cin >> num;
}
v[i].push_back(num);
}
for (auto& list : v)
{
bool flag = false;
for (auto& person : list)
{
if (flag)
break;
for (auto& t : know)
{
if (Find(person) == Find(t))
{
flag = true;
break;
}
}
}
if (flag)
m--;
}
cout << m;
}