#include <bits/stdc++.h>
using namespace std;
int parent[1005] = {};
int get(int x) {
  if (x == parent[x]) return x;
  return parent[x] = get(parent[x]);
}
long long int c(long long int n) { return n * (n - 1) / 2; }
int main() {
  ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  int n, m, k;
  cin >> n >> m >> k;
  vector<int> indep(k);
  for (int &i : indep) cin >> i;
  vector<long long int> sizeArr(n + 1);
  for (int i = 1; i <= n; i++) parent[i] = i;
  for (int i = 0; i < m; i++) {
    int x, y;
    cin >> x >> y;
    parent[get(y)] = get(x);
  }
  for (int i = 1; i <= n; i++) sizeArr[get(i)]++;
  long long int leftover = n;
  long long int ans = 0;
  long long int largest = 0;
  for (int i : indep) {
    int d = get(i);
    largest = max(largest, sizeArr[d]);
    ans += c(sizeArr[d]);
    leftover -= sizeArr[d];
  }
  ans -= c(largest);
  ans += c(largest + leftover);
  cout << ans - m << "\n";
  cerr << "Run time: " << fixed << setprecision(3)
       << (double)clock() / CLOCKS_PER_SEC << "s" << endl;
  return 0;
}
