#include <bits/stdc++.h>
using namespace std;
template <class T>
T sqr(T x) {
  return x * x;
}
template <class T>
string const toString(T const &x) {
  return (ostringstream() << x).str();
}
struct Node {
  vector<int> to;
  bool visited;
  Node() : visited(false) {}
};
vector<Node> g;
vector<int> c;
int n, m, k;
struct DfsRes {
  long long vCnt;
  long long eCnt;
};
DfsRes dfs(int u) {
  g[u].visited = true;
  DfsRes res = {1, 0};
  for (int i = 0; i < int((g[u].to).size()); ++i) {
    int v = g[u].to[i];
    res.eCnt += 1;
    if (!g[v].visited) {
      DfsRes tmp = dfs(v);
      res.vCnt += tmp.vCnt;
      res.eCnt += tmp.eCnt;
    }
  }
  return res;
}
int main() {
  cin >> n >> m >> k;
  c.resize(k);
  for (int i = 0; i < int(k); ++i) {
    cin >> c[i];
  }
  g.resize(n + 1);
  for (int i = 0; i < int(m); ++i) {
    int u, v;
    cin >> u >> v;
    g[u].to.push_back(v);
    g[v].to.push_back(u);
  }
  vector<DfsRes> cComps(k);
  for (int i = 0; i < int(k); ++i) {
    cComps[i] = dfs(c[i]);
    assert(cComps[i].eCnt % 2 == 0);
    cComps[i].eCnt /= 2;
  }
  int cBest = 0;
  for (int i = 1; i < k; ++i) {
    if (cComps[cBest].vCnt < cComps[i].vCnt) {
      cBest = i;
    }
  }
  long long res = 0;
  for (int i = 0; i < int(k); ++i) {
    if (i == cBest) continue;
    long long vCnt = cComps[i].vCnt;
    long long eCnt = cComps[i].eCnt;
    res += vCnt * (vCnt - 1) / 2 - eCnt;
  }
  long long vCumSum = cComps[cBest].vCnt;
  long long eCumSum = cComps[cBest].eCnt;
  for (int u = 1; u <= n; ++u) {
    if (g[u].visited) continue;
    DfsRes tmp = dfs(u);
    assert(tmp.eCnt % 2 == 0);
    tmp.eCnt /= 2;
    vCumSum += tmp.vCnt;
    eCumSum += tmp.eCnt;
  }
  res += vCumSum * (vCumSum - 1) / 2 - eCumSum;
  cout << res << endl;
  return 0;
}
