#include <bits/stdc++.h>
using namespace std;
struct Dsu {
  int n;
  vector<int> master;
  vector<int> size;
  Dsu(int nsize) {
    n = nsize;
    master.resize(n);
    size.resize(n, 1);
    for (int i = 0; i < n; i++) master[i] = i;
  }
  int getMaster(int pos) {
    if (master[pos] == pos) return pos;
    int ret = getMaster(master[pos]);
    master[pos] = ret;
    return ret;
  }
  bool unite(int a, int b) {
    a = getMaster(a);
    b = getMaster(b);
    if (a == b) return false;
    if (size[b] > size[a]) swap(a, b);
    master[b] = a;
    size[a] += size[b];
    return true;
  }
};
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  int n, m, k;
  cin >> n >> m >> k;
  int largest = -1;
  vector<int> c(k);
  vector<bool> govern(n, false);
  for (int i = 0; i < k; i++) {
    int cur;
    cin >> cur;
    cur--;
    c[i] = cur;
  }
  Dsu dsu(n);
  for (int i = 0; i < m; i++) {
    int u, v;
    cin >> u >> v;
    u--, v--;
    dsu.unite(u, v);
  }
  for (auto cur : c) {
    cur = dsu.getMaster(cur);
    if (largest == -1 || dsu.size[largest] < dsu.size[cur]) largest = cur;
    govern[cur] = true;
  }
  for (int i = 0; i < n; i++) {
    int cur = dsu.getMaster(i);
    if (!govern[cur]) {
      dsu.unite(largest, cur);
      largest = dsu.getMaster(cur);
      govern[largest] = true;
    }
  }
  int destm = 0;
  for (auto cur : c) {
    cur = dsu.getMaster(cur);
    destm += dsu.size[cur] * (dsu.size[cur] - 1) / 2;
  }
  cout << destm - m << '\n';
  return 0;
}
