#include <bits/stdc++.h>
using namespace std;
struct DSU {
  int count;
  vector<int> vs, ss;
  DSU(int n) : count(n), vs(n, -1), ss(n, 1) {
    for (int i = 0; i < n; i++) vs[i] = i;
  }
  int get(int x) { return x == vs[x] ? x : vs[x] = get(vs[x]); }
  void unite(int a, int b) {
    a = get(a);
    b = get(b);
    if (a == b) return;
    if (ss[a] > ss[b]) {
      vs[b] = a;
      ss[a] += ss[b];
    } else {
      vs[a] = b;
      ss[b] += ss[a];
    }
  }
};
int main() {
  int n, m, k;
  scanf("%d%d%d", &n, &m, &k);
  vector<int> cs(k);
  for (int i = 0; i < k; i++) {
    scanf("%d", &cs[i]);
    cs[i]--;
  }
  DSU dsu(n);
  for (int i = 0; i < m; i++) {
    int u, v;
    scanf("%d%d", &u, &v);
    u--, v--;
    dsu.unite(u, v);
  }
  int biggestCap = -1, biggestSize = -1;
  vector<int> capitals(n, -1);
  for (int i = 0; i < k; i++) {
    int capSet = dsu.get(cs[i]);
    capitals[capSet] = cs[i];
    if (dsu.ss[capSet] > biggestSize) {
      biggestSize = dsu.ss[capSet];
      biggestCap = cs[i];
    }
  }
  for (int i = 0; i < n; i++) {
    int nodeSet = dsu.get(i);
    if (capitals[nodeSet] < 0) {
      dsu.unite(i, biggestCap);
    }
  }
  set<int> sets;
  for (int i = 0; i < n; i++) sets.insert(dsu.get(i));
  int total = 0;
  for (int s : sets) {
    int ssize = dsu.ss[s];
    total += ssize * (ssize - 1) / 2;
  }
  total -= m;
  printf("%d\n", total);
  return 0;
}
