#include <bits/stdc++.h>
using namespace std;
using lli = long long int;
using pii = tuple<lli, lli>;
using piii = tuple<lli, lli, lli>;
using vi = vector<lli>;
using vii = vector<pii>;
using viii = vector<piii>;
using vvi = vector<vi>;
using vvii = vector<vii>;
using vviii = vector<viii>;
using vb = vector<bool>;
using vvb = vector<vb>;
template <class A, class B>
ostream& operator<<(ostream& s, tuple<A, B> const& a) {
  return s << "(" << get<0>(a) << "," << get<1>(a) << ")";
}
template <class T>
ostream& print_collection(ostream& s, T const& a) {
  for (auto it = begin(a); it != end(a); ++it) {
    s << *it;
    if (next(it) != end(a)) s << " ";
  }
  return s;
}
template <class T>
ostream& operator<<(ostream& s, vector<T> const& a) {
  return print_collection(s, a);
}
template <class T>
ostream& operator<<(ostream& s, set<T> const& a) {
  return print_collection(s, a);
}
int main() {
  lli n, m, k;
  scanf("%lld%lld%lld", &n, &m, &k);
  vi gov(k);
  vvi adj(n);
  for (lli i = 0; i < (lli)(k); ++i) {
    scanf("%lld", &gov[i]);
    gov[i] -= 1;
  }
  for (lli i = 0; i < (lli)(m); ++i) {
    lli x, y;
    scanf("%lld%lld", &x, &y);
    x--;
    y--;
    adj[x].push_back(y);
    adj[y].push_back(x);
  }
  vi comps(n);
  vb seen(n, false);
  lli nbComp = 0;
  vi compSize;
  function<void(lli)> dfsComp = [&](lli node) {
    seen[node] = true;
    comps[node] = nbComp;
    compSize.back() += 1;
    for (lli i : adj[node]) {
      if (!seen[i]) {
        dfsComp(i);
      }
    }
  };
  for (lli i = 0; i < (lli)(n); ++i) {
    if (!seen[i]) {
      compSize.push_back(0);
      dfsComp(i);
      nbComp += 1;
    }
  }
  lli mSize = 0;
  for (lli i = 0; i < (lli)(k); ++i) {
    mSize = max(mSize, compSize[comps[gov[i]]]);
  }
  vb noGov(nbComp, true);
  for (lli i = 0; i < (lli)(k); ++i) {
    noGov[comps[gov[i]]] = false;
  }
  vi nbEdge(nbComp);
  for (lli i = 0; i < (lli)(n); ++i) {
    nbEdge[comps[i]] += adj[i].size();
  }
  for (lli i = 0; i < (lli)(nbComp); ++i) {
    nbEdge[i] /= 2;
  }
  lli res = 0;
  for (lli i = 0; i < (lli)(nbComp); ++i) {
    res += ((compSize[i] * (compSize[i] - 1)) / 2 - nbEdge[i]);
    if (noGov[i]) {
      res += mSize * compSize[i];
      mSize += compSize[i];
    }
  }
  printf("%lld\n", res);
  return 0;
}
