#include <bits/stdc++.h>
using namespace std;
int n, m, k;
long long nodes;
long long tnodes;
vector<int> mark;
vector<int> save;
vector<int> graph[1001];
int visi[1001];
void dfs(int u) {
  visi[u] = 1;
  nodes++;
  tnodes++;
  for (int c = 0; c < graph[u].size(); c++) {
    int nei = graph[u][c];
    if (visi[nei] == 0) {
      dfs(nei);
    }
  }
}
long long formula(long long v) {
  v--;
  return (v * (v + 1)) / 2;
}
void Clear() {
  mark.clear();
  save.clear();
  for (int c = 0; c < 1001; c++) {
    graph[c].clear();
    visi[c] = 0;
  }
  nodes = 0;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cin >> n >> m >> k;
  int node;
  while (k-- > 0) {
    cin >> node;
    mark.push_back(node);
  }
  int u, v;
  for (int c = 0; c < m; c++) {
    cin >> u >> v;
    graph[u].push_back(v);
    graph[v].push_back(u);
  }
  long long ans = 0;
  for (int c = 0; c < mark.size(); c++) {
    tnodes = 0;
    dfs(mark[c]);
    save.push_back(tnodes);
    ans += formula(tnodes);
  }
  ans += formula(n - nodes);
  long long maxx = 0;
  for (int c = 0; c < save.size(); c++) {
    maxx = max(save[c] * (n - nodes), maxx);
  }
  ans += maxx;
  cout << (ans - m) << endl;
  return 0;
}
