#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e4 + 4;
int par[maxn];
int rankx[maxn];
int n, m, k;
int gov[maxn];
int num[maxn];
void init(int n) {
  for (int i = 1; i <= n; i++) {
    par[i] = i;
    rankx[i] = 0;
  }
}
int findx(int x) {
  if (par[x] == x)
    return x;
  else
    return par[x] = findx(par[x]);
}
void unite(int x, int y) {
  x = findx(x);
  y = findx(y);
  if (x == y) return;
  if (rankx[x] < rankx[y]) {
    par[x] = y;
    num[y] += num[x];
  } else {
    par[y] = x;
    num[x] += num[y];
    if (rankx[x] == rankx[y]) rankx[x]++;
  }
}
bool same(int x, int y) { return findx(x) == findx(y); }
int main() {
  scanf("%d%d%d", &n, &m, &k);
  init(n);
  for (int i = 1; i <= n; i++) num[i] = 1;
  int x, y;
  for (int i = 1; i <= k; i++) {
    scanf("%d", &x);
    gov[i] = x;
  }
  for (int i = 1; i <= m; i++) {
    scanf("%d%d", &x, &y);
    unite(x, y);
  }
  int nm = 0;
  for (int i = 1; i <= k; i++) nm = max(nm, num[findx(gov[i])]);
  bool flag = 1;
  int number = 0;
  long long ans = 0;
  for (int i = 1; i <= k; i++) {
    int fa = findx(gov[i]);
    if (num[fa] == nm && flag)
      flag = 0;
    else
      number += num[fa];
  }
  flag = 1;
  for (int i = 1; i <= k; i++) {
    int fa = findx(gov[i]);
    if (num[fa] == nm && flag) {
      flag = 0;
      ans += (long long)(n - number) * (n - number - 1) / 2;
    } else
      ans += (long long)(num[fa]) * (num[fa] - 1) / 2;
  }
  ans -= m;
  cout << ans << endl;
}
