#include <bits/stdc++.h>
using namespace std;
long long sqr(long long first) { return first * first; }
const double PI = acos(-1);
const int MAXN = 2e6 + 10;
const int INF = 1e9;
const long long md = 1e9 + 7;
const long long md2 = 2e9 + 7;
const long long RNG = 1e18;
long long bpow(long long a, long long b) {
  long long res = 1;
  while (b > 0) {
    if (b & 1ll) res = (res * a);
    a = (a * a);
    b >>= 1ll;
  }
  return res;
}
int n, m, k;
vector<int> g[MAXN], cnt[MAXN];
int c[MAXN];
int vis[MAXN];
int dfs(int v, int c) {
  vis[v] = c;
  cnt[c].push_back(v);
  int res = 1;
  for (auto to : g[v])
    if (!vis[to]) res += dfs(to, c);
  return res;
}
int main() {
  scanf(
      "%d"
      "%d"
      "%d",
      &n, &m, &k);
  for (int i = 1; i <= k; i++) scanf("%d", &c[i]);
  while (m--) {
    int u, v;
    scanf(
        "%d"
        "%d",
        &u, &v);
    g[u].push_back(v);
    g[v].push_back(u);
  }
  long long ans = 0;
  long long mxx = 0;
  for (int i = 1; i <= k; i++) {
    long long cur = dfs(c[i], i);
    mxx = max(mxx, cur);
    long long mx = cur * (cur - 1) / 2;
    long long t = 0;
    for (auto v : cnt[i]) t += int(g[v].size());
    t /= 2;
    ans += mx - t;
  }
  long long cur = 0, t = 0;
  for (int i = 1; i <= n; i++)
    if (!vis[i]) cur++, t += g[i].size();
  if (cur > 0)
    ans += (mxx + cur) * (mxx + cur - 1) / 2 - t / 2 - mxx * (mxx - 1) / 2;
  cout << ans;
}
