#include <bits/stdc++.h>
const long long oo = 2 * 1000 * 1000 * 1000;
const int _cnt = 1000 * 1000;
const int _p = 1000 * 1000 * 1000 + 7;
long long o(long long x) { return x % _p; }
int gcd(int a, int b) { return b ? gcd(b, a % b) : a; }
int lcm(int a, int b) { return a * b / gcd(a, b); }
using namespace std;
void file_put() {
  freopen("filename.in", "r", stdin);
  freopen("filename.out", "w", stdout);
}
int home[1005], c[1005], a[1005], num[1005], mm[1005];
int n, m, k, x, y, p, q, ans = 0;
int _find(int k) {
  if (home[k] == k) return k;
  return home[k] = _find(home[k]);
}
int main() {
  scanf("%d%d%d", &n, &m, &k);
  for (int i = 1; i <= k; i++) scanf("%d", &c[i]);
  for (int i = 1; i <= n; i++) home[i] = i;
  for (int i = 1; i <= n; i++) num[i] = 1;
  memset(a, 0, sizeof(a));
  for (int i = 1; i <= m; i++) {
    scanf("%d%d", &x, &y);
    p = _find(x);
    q = _find(y);
    a[q]++;
    if (p == q) continue;
    home[p] = q;
    num[q] += num[p];
    num[p] = 0;
    a[q] += a[p];
  }
  for (int i = 1; i <= k; i++) {
    p = _find(c[i]);
    mm[p] = 1;
    ans += num[p] * (num[p] - 1) / 2 - a[p];
  }
  int total = 0, sum = 0;
  for (int i = 1; i <= n; i++) {
    p = _find(i);
    if (mm[p]) continue;
    mm[p] = 2;
    total += num[p];
    sum += a[p];
  }
  int maxnum = -oo, index = 0;
  ans += total * (total - 1) / 2 - sum;
  for (int i = 1; i <= k; i++) {
    p = _find(c[i]);
    if (num[p] > maxnum) {
      maxnum = num[p];
      index = p;
    }
  }
  ans += total * num[index];
  cout << ans << endl;
  return 0;
}
