#include <bits/stdc++.h>
using namespace std;
int n, m, k;
long long tgcanh, tgdinh;
vector<long long> dsdinh, dscanh;
vector<int> goc;
set<int> dschinhphu;
int findRoot(int x) {
  if (goc[x] == x)
    return x;
  else
    return goc[x] = findRoot(goc[x]);
}
void Solve() {
  cin >> n >> m >> k;
  tgcanh = 0, tgdinh = n - k;
  goc.resize(n + 10);
  for (int i = 1; i <= n; ++i) goc[i] = i;
  dsdinh.assign(n + 10, 1), dscanh.assign(n + 10, 0);
  int tam, u, v;
  for (int i = 0; i < k; ++i) {
    cin >> tam;
    dschinhphu.insert(tam);
  }
  for (int i = 0; i < m; ++i) {
    cin >> u >> v;
    int ru = findRoot(u), rv = findRoot(v);
    if (dschinhphu.find(ru) != dschinhphu.end()) {
      if (ru != rv)
        goc[rv] = ru, dsdinh[ru] += dsdinh[rv], dscanh[ru] += (dscanh[rv] + 1),
        tgdinh -= dsdinh[rv], tgcanh -= dscanh[rv];
      else
        dscanh[ru] += 1;
    } else if (dschinhphu.find(rv) != dschinhphu.end()) {
      if (rv != ru)
        goc[ru] = rv, dsdinh[rv] += dsdinh[ru], dscanh[rv] += (dscanh[ru] + 1),
        tgdinh -= dsdinh[ru], tgcanh -= dscanh[ru];
      else
        dscanh[rv] += 1;
    } else {
      if (ru != rv) {
        if (dsdinh[ru] > dsdinh[rv]) swap(ru, rv);
        goc[ru] = rv, dsdinh[rv] += dsdinh[ru], dscanh[rv] += (dscanh[ru] + 1),
        tgcanh += 1;
      } else
        dscanh[rv] += 1, tgcanh += 1;
    }
  }
  long long ans = -1, vt = -1;
  for (auto x : dschinhphu) {
    long long dinh = dsdinh[x] + tgdinh, canh = dscanh[x] + tgcanh,
              tinhtam = ((dinh * (dinh - 1)) / 2) - canh;
    if (ans < tinhtam) ans = tinhtam, vt = x;
  }
  for (auto x : dschinhphu)
    if (x != vt) ans += ((dsdinh[x] * (dsdinh[x] - 1)) / 2) - dscanh[x];
  cout << ans << '\n';
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  Solve();
  return 0;
}
