#include <bits/stdc++.h>
using namespace std;
const int maxn = 1000 + 10;
int n, m, k;
int home[maxn];
int fa[maxn];
int cnt[maxn];
int find(int x) { return fa[x] == x ? fa[x] : fa[x] = find(fa[x]); }
int main() {
  while (scanf("%d%d%d", &n, &m, &k) == 3) {
    for (int i = 1; i <= n; i++) fa[i] = i;
    memset(cnt, 0, sizeof cnt);
    for (int i = 1; i <= k; i++) scanf("%d", &home[i]);
    for (int i = 1; i <= m; i++) {
      int u, v;
      scanf("%d%d", &u, &v);
      int x = find(u), y = find(v);
      if (x != y) fa[x] = y;
    }
    for (int i = 1; i <= n; i++) find(i);
    int ans = 0;
    for (int i = 1; i <= n; i++) cnt[fa[i]]++;
    int mx = 0;
    int sum = 0;
    for (int i = 1; i <= k; i++) {
      int u = home[i];
      sum += cnt[fa[u]];
      mx = max(mx, cnt[fa[u]]);
      ans += cnt[fa[u]] * (cnt[fa[u]] - 1) / 2;
    }
    ans -= mx * (mx - 1) / 2;
    sum = mx + n - sum;
    ans += (sum - 1) * sum / 2;
    ans -= m;
    printf("%d\n", ans);
  }
  return 0;
}
