#include <bits/stdc++.h>
using namespace std;
const int N = 10005, M = 100005;
int n, m, k, r[N], tot, lnk[N], nxt[M << 1], son[M << 1];
int cnt, cn, ce, mx, num, vis[N];
bool b[N];
long long ans;
void add(int x, int y) { nxt[++tot] = lnk[x], lnk[x] = tot, son[tot] = y; }
void dfs(int x, int c) {
  vis[x] = c, ++cn;
  for (int j = lnk[x]; j; j = nxt[j]) {
    ++ce;
    if (vis[son[j]]) continue;
    dfs(son[j], c);
  }
}
int Cn2(int x) { return x * (x - 1) >> 1; }
int main() {
  scanf("%d%d%d", &n, &m, &k), tot = 0;
  for (int i = 1; i <= k; ++i) scanf("%d", &r[i]), b[r[i]] = 1;
  for (int i = 1, x, y; i <= m; ++i) {
    scanf("%d%d", &x, &y);
    add(x, y), add(y, x);
  }
  mx = num = 0;
  for (int i = 1; i <= k; ++i) {
    ce = cn = 0, ++cnt;
    dfs(r[i], cnt);
    ce >>= 1, ans += Cn2(cn) - ce, mx = max(mx, cn);
  }
  for (int i = 1; i <= n; ++i)
    if (!vis[i]) {
      ce = cn = 0;
      dfs(i, ++cnt);
      ce >>= 1, ans -= ce, num += cn;
    }
  ans += 1ll * Cn2(num) + 1ll * mx * num;
  cout << ans << endl;
  return 0;
}
