#include <bits/stdc++.h>
using namespace std;
int parent[1111];
int edges[1111];
bool isHome[1111];
int get(int x) {
  if (x == parent[x]) return x;
  return parent[x] = get(parent[x]);
}
void merge(int a, int b) {
  a = get(a);
  b = get(b);
  if (a == b) {
    edges[a]++;
    return;
  }
  isHome[a] |= isHome[b];
  edges[a] += edges[b] + 1;
  parent[b] = a;
}
int main() {
  cin.tie(0);
  ios_base::sync_with_stdio(0);
  int n, m, k;
  int a, b, c;
  cin >> n >> m >> k;
  for (int i = 0; i <= n; i++) {
    parent[i] = i;
    isHome[i] = edges[i] = 0;
  }
  for (int i = 0; i < k; i++) {
    cin >> a;
    isHome[a] = true;
  }
  for (int i = 0; i < m; i++) {
    cin >> a >> b;
    merge(a, b);
  }
  map<int, int> comps;
  int pnode = 0, pedge = 0;
  for (int i = 1; i <= n; i++) {
    a = get(i);
    if (!isHome[a]) {
      pnode++;
      pedge += edges[a];
      edges[a] = 0;
    } else
      comps[a]++;
  }
  map<int, int>::iterator it;
  int bco = 0, bed = 0;
  int ans = 0, nn;
  for (it = comps.begin(); it != comps.end(); it++) {
    c = (*it).first;
    nn = (*it).second;
    if (nn > bco) {
      bco = nn;
      bed = edges[c];
    } else if (nn == bco && bed > edges[c]) {
      bed = edges[c];
    }
    ans += nn * (nn - 1) / 2 - edges[c];
  }
  ans -= bco * (bco - 1) / 2 - bed;
  bco += pnode;
  bed += pedge;
  ans += bco * (bco - 1) / 2 - bed;
  cout << ans << '\n';
  return 0;
}
