#include <bits/stdc++.h>
using namespace std;
int homes[1005], clusterSz[1005], nbEdges[1005];
bool visited[1005];
unordered_map<int, set<int>> graph;
set<pair<int, int>> edges;
void dfs(int n, int k) {
  if (visited[n]) return;
  clusterSz[k]++;
  clusterSz[0]--;
  visited[n] = true;
  for (int x : graph[n]) {
    if (edges.count({x, n})) {
      nbEdges[k]++;
      edges.erase({x, n});
      edges.erase({n, x});
    }
    dfs(x, k);
  }
}
int main() {
  int n, m, k;
  cin >> n >> m >> k;
  for (int i = 0; i < k; i++) cin >> homes[i];
  clusterSz[0] = n;
  for (int i = 0; i < m; i++) {
    int a, b;
    cin >> a >> b;
    graph[a].insert(b);
    graph[b].insert(a);
    edges.insert({a, b});
    edges.insert({b, a});
  }
  for (int i = 0; i < k; i++) dfs(homes[i], homes[i]);
  nbEdges[0] = edges.size() / 2;
  int maxVal = 0;
  int ans = clusterSz[0] * (clusterSz[0] - 1) / 2 - nbEdges[0];
  for (int i = 1; i <= n; i++) {
    int x = clusterSz[i];
    maxVal = max(maxVal, x);
    ans += x * (x - 1) / 2;
    ans -= nbEdges[i];
  }
  ans += clusterSz[0] * maxVal;
  printf("%d", ans);
  return 0;
}
