#include <bits/stdc++.h>
using namespace std;
int n, m, k;
vector<int> arr, vis;
vector<vector<int> > gr;
int ans = 0;
int usedN = 0, usedE = 0, Max = 0;
void dfsVisit(int node, int &no, int &ed) {
  vis[node] = 1;
  no++;
  ed += gr[node].size();
  for (int i = 0; i < gr[node].size(); i++) {
    if (vis[gr[node][i]] == 0) {
      dfsVisit(gr[node][i], no, ed);
    }
  }
}
void dfs() {
  for (int i = 0; i < k; i++) {
    if (vis[arr[i]] == 0) {
      int nodes = 0;
      int edges = 0;
      dfsVisit(arr[i], nodes, edges);
      Max = max(Max, nodes);
      ans += (nodes * (nodes - 1)) / 2 - edges / 2;
      usedN += nodes;
      usedE += edges / 2;
    }
  }
  int left = n - usedN;
  ans += (left * (left - 1)) / 2 - (m - usedE);
  ans += left * Max;
}
int main() {
  ios::sync_with_stdio(false);
  cin >> n >> m >> k;
  arr.resize(k);
  for (int i = 0; i < k; i++) {
    cin >> arr[i];
  }
  gr.resize(n + 1);
  vis.resize(n + 1, 0);
  for (int i = 0; i < m; i++) {
    int u, v;
    cin >> u >> v;
    gr[u].push_back(v);
    gr[v].push_back(u);
  }
  dfs();
  cout << ans << "\n";
  return 0;
}
