#include <bits/stdc++.h>
using namespace std;
int n, m, l;
int a[1050];
vector<int> q[1050];
bool vis[1050];
int maxx;
int bfs(int u) {
  int res = 0;
  queue<int> que;
  que.push(u);
  int r = 1;
  vis[u] = false;
  res += q[u].size();
  while (!que.empty()) {
    int f = que.front();
    que.pop();
    for (int i = 0; i < q[f].size(); i++) {
      int v = q[f][i];
      if (vis[v] == true) {
        vis[v] = false;
        res += q[v].size();
        r++;
        que.push(v);
      }
    }
  }
  res /= 2;
  if (r > maxx) maxx = r;
  r *= (r - 1);
  r /= 2;
  return r - res;
}
int main() {
  scanf("%d%d%d", &n, &m, &l);
  for (int i = 1; i <= l; i++) scanf("%d", &a[i]);
  for (int i = 1; i <= n; i++) q[i].clear();
  for (int i = 1; i <= m; i++) {
    int u, v;
    scanf("%d%d", &u, &v);
    q[u].push_back(v);
    q[v].push_back(u);
  }
  maxx = 0;
  memset(vis, true, sizeof(vis));
  int ans = 0;
  for (int i = 1; i <= l; i++) {
    vis[a[i]] = false;
    int z = bfs(a[i]);
    ans += z;
  }
  int c = 0;
  for (int i = 1; i <= n; i++) {
    if (vis[i] == true) {
      c += q[i].size();
      ans += maxx;
      maxx++;
    }
  }
  c /= 2;
  ans -= c;
  printf("%d\n", ans);
}
