#include <bits/stdc++.h>
using namespace std;
vector<vector<int>> arr;
int curr = 0;
vector<bool> vis;
int dfs(int i, int& j) {
  if (vis[i]) return 0;
  j++;
  vis[i] = true;
  int c = 0;
  for (auto x : arr[i]) {
    c++;
    c += dfs(x, j);
  }
  return c;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int n, m, k;
  cin >> n >> m >> k;
  arr.resize(n + 1);
  vis.resize(n + 1, false);
  set<int> gvs;
  for (int i = 0; i < k; i++) {
    int temp;
    cin >> temp;
    gvs.insert(temp);
  }
  for (int i = 0; i < m; i++) {
    int a, b;
    cin >> a >> b;
    arr[a].push_back(b);
    arr[b].push_back(a);
  }
  long long ans = 0;
  int mx = 0;
  for (auto i : gvs) {
    int num = 0;
    if (!vis[i]) {
      int edges = dfs(i, num);
      edges /= 2;
      ans += num * (num - 1) / 2 - edges;
      mx = max(mx, num);
    }
  }
  int edg = 0;
  for (int i = 1; i < n + 1; i++) {
    int hmm = 0;
    edg += dfs(i, hmm) / 2;
    curr += hmm;
  }
  ans -= mx * (mx - 1) / 2;
  mx += curr;
  ans += mx * (mx - 1) / 2;
  cout << ans - edg;
}
