#include <bits/stdc++.h>
using namespace std;
vector<int> v[200000];
long long int ck[200000], vis[200000], mx = -1, x, y, finalIndx;
long long int bfs(long long int indx) {
  long long int cnt = 1;
  vis[indx] = indx;
  queue<long long int> que;
  que.push(indx);
  while (!que.empty()) {
    int f = que.front();
    que.pop();
    for (int i = 0; i < v[f].size(); i++) {
      if (vis[v[f][i]] == 0) {
        cnt++;
        que.push(v[f][i]);
        vis[v[f][i]] = indx;
      }
    }
  }
  return cnt;
}
map<pair<long long int, long long int>, int> used;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long int n, m, k, connected = 0, ans = 0;
  cin >> n >> m >> k;
  for (int i = 0; i < k; i++) {
    cin >> x;
    ck[x] = 1;
  }
  for (int i = 0; i < m; i++) {
    cin >> x >> y;
    v[x].push_back(y);
    v[y].push_back(x);
    used[{min(x, y), max(x, y)}] = 1;
  }
  for (int i = 1; i <= n; i++) {
    if (ck[i]) {
      long long int tmp = bfs(i);
      if (tmp > mx) {
        mx = tmp;
        finalIndx = i;
      }
    }
  }
  for (int i = 1; i <= n; i++) {
    if (vis[i] == finalIndx) {
      for (int j = 1; j <= n; j++) {
        if (vis[j] == 0) {
          ans++;
          vis[j] = finalIndx;
          used[{min(i, j), max(i, j)}] = 1;
        }
      }
    }
  }
  for (int i = 1; i <= n; i++) {
    for (int j = i + 1; j <= n; j++) {
      if (used[{i, j}] == 0) {
        if (vis[i] == vis[j]) {
          ans++;
          used[{i, j}] = 1;
        }
      }
    }
  }
  cout << ans << endl;
}
