#include <bits/stdc++.h>
using namespace std;
vector<int> g[1005];
int c[1005], gov[1005], comp[1005];
bool used[1005], fr[1005], matched[1005];
int beg, cnt;
void DFS(int v) {
  int i;
  used[v] = true;
  fr[v] = false;
  gov[v] = beg;
  cnt++;
  for (i = 0; i < g[v].size(); i++)
    if (!used[g[v][i]]) DFS(g[v][i]);
}
int main() {
  int n, m, k, i, u, v, frcnt, ans, mx, mxi;
  bool can;
  scanf("%d%d%d", &n, &m, &k);
  for (i = 1; i <= n; i++) fr[i] = true;
  for (i = 1; i <= k; i++) {
    scanf("%d", &c[i]);
    fr[c[i]] = false;
  }
  for (i = 1; i <= m; i++) {
    scanf("%d%d", &u, &v);
    g[u].push_back(v);
    g[v].push_back(u);
  }
  mx = 0;
  for (i = 1; i <= k; i++) {
    cnt = 0;
    beg = c[i];
    DFS(c[i]);
    comp[c[i]] = cnt;
    if (comp[c[i]] > mx) {
      mx = comp[c[i]];
      mxi = c[i];
    }
  }
  frcnt = 0;
  for (i = 1; i <= n; i++)
    if (fr[i]) frcnt++;
  ans = ((frcnt + mx) * (frcnt + mx - 1)) / 2;
  matched[mxi] = true;
  for (i = 1; i <= k; i++)
    if (comp[c[i]] > 1 && !matched[c[i]])
      ans += ((comp[c[i]]) * (comp[c[i]] - 1)) / 2;
  printf("%d\n", ans - m);
  return 0;
}
