#include <bits/stdc++.h>
using namespace std;
vector<bool> visited;
vector<vector<int>> g;
int dfs(int v) {
  if (visited[v]) return 0;
  visited[v] = true;
  int res = 1;
  for (auto u : g[v]) res += dfs(u);
  return res;
}
int main() {
  int n, m, k;
  cin >> n >> m >> k;
  vector<int> cap(k);
  for (int i = 0; i < k; i++) cin >> cap[i];
  visited.resize(n);
  g.resize(n);
  for (int i = 0; i < m; i++) {
    int a, b;
    cin >> a >> b;
    a--;
    b--;
    g[a].push_back(b);
    g[b].push_back(a);
  }
  vector<int> c_size(k);
  for (int i = 0; i < k; i++) c_size[i] = dfs(cap[i] - 1);
  long long res = 0;
  sort(c_size.begin(), c_size.end());
  int fre = 0;
  for (int i = 0; i < n; i++)
    if (!visited[i]) fre++;
  for (int i = 0; i < k - 1; i++) res += c_size[i] * (c_size[i] - 1) / 2;
  int curr = c_size.back() + fre;
  res += curr * (curr - 1) / 2;
  cout << res - m;
}
