#include <bits/stdc++.h>
using namespace std;
void dfs(vector<bool> &visited, vector<int> adj[], int u, long long &cc_gov,
         long long &cc_edg) {
  visited[u] = 1;
  ++cc_gov, cc_edg += adj[u].size();
  for (int v : adj[u]) {
    if (!visited[v]) dfs(visited, adj, v, cc_gov, cc_edg);
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int n, m, k;
  cin >> n >> m >> k;
  vector<int> adj[n + 1], govt(k);
  vector<bool> visited(n + 1, 0);
  for (int i = 0; i < k; i++) cin >> govt[i];
  for (int i = 0; i < m; i++) {
    int u, v;
    cin >> u >> v;
    adj[u].push_back(v), adj[v].push_back(u);
  }
  long long max_cc_govt = 0, max_cc_edg = 0, ans = 0;
  for (auto gov : govt) {
    long long cc_govt = 0, cc_edg = 0;
    if (!visited[gov]) {
      dfs(visited, adj, gov, cc_govt, cc_edg);
      cc_edg >>= 1, ans += (cc_govt * (cc_govt - 1) / 2) - cc_edg;
      if (cc_govt > max_cc_govt) {
        max_cc_govt = cc_govt;
        max_cc_edg = cc_govt * (cc_govt - 1) / 2;
      }
    }
  }
  long long pvt = 0, pvt_edg = 0;
  for (int i = 1; i <= n; i++) {
    if (!visited[i]) {
      ++pvt;
      pvt_edg += adj[i].size();
    }
  }
  pvt_edg >>= 1;
  long long net_nodes = pvt + max_cc_govt;
  ans += net_nodes * (net_nodes - 1) / 2 - max_cc_edg - pvt_edg;
  cout << ans << "\n";
  return 0;
}
