#include <bits/stdc++.h>
using namespace std;
bool isgov[1001];
vector<long long int> adj[1001];
bool visited[1001];
long long int n, m, k, x, y;
long long int ans = 0;
long long int t_edges = 0;
long long int govflag = 0;
long long int a1;
long long int mnodes = 0;
long long int t_nodes = 0;
long long int ng_nodes = 0;
void dfs(long long int i) {
  visited[i] = true;
  if (isgov[i]) govflag = 1;
  t_nodes++;
  t_edges += adj[i].size();
  for (int j = 0; j < adj[i].size(); j++) {
    if (!visited[adj[i][j]]) dfs(adj[i][j]);
  }
}
int main() {
  scanf("%lld%lld%lld", &n, &m, &k);
  memset(isgov, false, sizeof isgov);
  memset(visited, false, sizeof visited);
  for (int i = 0; i < k; i++) {
    scanf("%lld", &a1);
    isgov[a1] = true;
  }
  while (m--) {
    scanf("%lld%lld", &x, &y);
    adj[x].push_back(y);
    adj[y].push_back(x);
  }
  for (int i = 1; i <= n; i++) {
    if (!visited[i]) {
      dfs(i);
      ans += (t_nodes * (t_nodes - 1) - t_edges) / 2;
      if (govflag) {
        if (t_nodes > mnodes) mnodes = t_nodes;
      } else {
        ans += ng_nodes * t_nodes;
        ng_nodes += t_nodes;
      }
      t_nodes = 0;
      t_edges = 0;
      govflag = 0;
    }
  }
  ans += ng_nodes * mnodes;
  printf("%lld", ans);
  return 0;
}
