#include <bits/stdc++.h>
using namespace std;
std::vector<std::vector<long long> > G(1005);
bool marked[1005];
long long component[1005];
long long govt[1005];
long long n;
std::vector<long long> nodes, edges;
void dfs(long long u, long long t, long long &noe, long long &non) {
  marked[u] = true;
  component[u] = t;
  non++;
  for (auto v : G[u]) {
    noe++;
    if (!marked[v]) dfs(v, t, noe, non);
  }
}
long long ans = 0;
void find_component() {
  long long noe, non;
  long long t = 1;
  for (int i = 1; i <= n; ++i) {
    if (!marked[i]) {
      non = noe = 0;
      dfs(i, t, noe, non);
      ++t;
      nodes.push_back(non);
      edges.push_back(noe / 2);
      ans += (non * (non - 1)) / 2 - noe / 2;
    }
  }
}
int main(int argc, char const *argv[]) {
  memset(marked, 0, sizeof(marked));
  memset(component, 0, sizeof(component));
  long long m, k, i, j, u, v;
  cin >> n >> m >> k;
  for (i = 0; i < k; i++) cin >> govt[i];
  for (i = 0; i < m; i++) {
    cin >> u >> v;
    G[u].push_back(v);
    G[v].push_back(u);
  }
  find_component();
  set<long long> govt_component;
  long long max_gc = 0, max_size = INT_MIN;
  for (i = 0; i < k; ++i) {
    govt_component.insert(component[govt[i]]);
    if (max_size < nodes[component[govt[i]] - 1])
      max_size = nodes[component[govt[i]] - 1];
  }
  long long tot_nodes = 0, temp = 0;
  for (i = 0; i < nodes.size(); ++i) {
    if (govt_component.find(i + 1) == govt_component.end()) {
      ans += tot_nodes * nodes[i];
      tot_nodes += nodes[i];
    }
  }
  ans += max_size * tot_nodes;
  cout << ans << endl;
  return 0;
}
