#include <bits/stdc++.h>
using namespace std;
const int maxn = 1005, maxm = 100005;
struct graph {
  struct edge {
    edge *pre;
    int son;
    void add(edge *p, int s) { pre = p, son = s; }
  } e[maxm * 2], *pos[maxn];
  int tot;
  graph() { tot = 0, memset(pos, 0, sizeof(pos)); }
  void connect(int u, int v) {
    e[tot].add(pos[u], v), pos[u] = e + tot++;
    e[tot].add(pos[v], u), pos[v] = e + tot++;
  }
} g;
int n, m, k, gov[maxn];
void init() {
  cin >> n >> m >> k;
  for (int i = 1; i <= k; ++i) cin >> gov[i];
  for (int u, v, i = 1; i <= m; ++i) cin >> u >> v, g.connect(u, v);
}
int cnt, loc[maxn], siz[maxn];
void dfs(int u) {
  loc[u] = cnt, ++siz[cnt];
  for (graph::edge *p = g.pos[u]; p; p = p->pre)
    if (!loc[p->son]) dfs(p->son);
}
void work() {
  cnt = 0, memset(loc, 0, sizeof(loc));
  for (int i = 1; i <= n; ++i) {
    if (loc[i]) continue;
    siz[++cnt] = 0, dfs(i);
  }
  static bool got_gov[maxn];
  memset(got_gov, 0, sizeof(got_gov));
  for (int i = 1; i <= k; ++i) got_gov[loc[gov[i]]] = 1;
  int id = -1, sum = 0;
  for (int i = 1; i <= cnt; ++i)
    if (!got_gov[i])
      sum += siz[i];
    else if (id == -1 || siz[i] > siz[id])
      id = i;
  if (id != -1) sum += siz[id];
  int ans = sum * (sum - 1) >> 1;
  for (int i = 1; i <= cnt; ++i)
    if (got_gov[i] && i != id) ans += siz[i] * (siz[i] - 1) >> 1;
  cout << ans - m << endl;
}
int main() {
  init();
  work();
  return 0;
}
