#include <bits/stdc++.h>
using namespace std;
const int p = 1e9 + 7;
const int inf = 2e9 + 9e2;
const int MAXN = 1050;
int fa[MAXN], n, m, k, i, s[MAXN], a[MAXN];
int gf(int x) { return fa[x] == x ? x : fa[x] = gf(fa[x]); }
int main() {
  scanf("%d%d%d", &n, &m, &k);
  int mm = m;
  for (i = 1; i <= n; i++) {
    fa[i] = i;
    s[i] = 1;
  }
  for (i = 1; i <= k; i++) scanf("%d", &a[i]);
  while (m--) {
    int u, v;
    scanf("%d%d", &u, &v);
    u = gf(u);
    v = gf(v);
    if (u != v) {
      if (s[u] > s[v]) swap(u, v);
      fa[u] = v;
      s[v] += s[u];
    }
  }
  int tot = 0;
  for (i = 1; i <= k; i++) {
    a[i] = s[gf(a[i])];
    tot += a[i];
  }
  sort(a + 1, a + k + 1);
  a[k] += n - tot;
  long long ans = 0;
  for (i = 1; i <= k; i++) ans += 1LL * a[i] * (a[i] - 1) / 2;
  printf("%lld", ans - mm);
  return 0;
}
