#include <bits/stdc++.h>
using namespace std;
bool flag[1002];
int pre[1005];
int has[1005];
int point[1005];
int fin(int a) {
  if (pre[a] == a) return a;
  return pre[a] = fin(pre[a]);
}
void uni(int a, int b) {
  int aa = fin(a);
  int bb = fin(b);
  if (aa == bb) {
    has[aa]++;
    return;
  }
  if (flag[bb]) {
    swap(aa, bb);
    swap(a, b);
  }
  has[aa] += has[bb] + 1;
  pre[bb] = aa;
  point[aa] += point[bb];
}
int n, m, k;
int main() {
  scanf("%d%d%d", &n, &m, &k);
  for (int i = 1; i <= k; i++) {
    int nouse;
    scanf("%d", &nouse);
    flag[nouse] = true;
  }
  for (int i = 1; i <= n; i++) {
    has[i] = 0;
    point[i] = 1;
    pre[i] = i;
  }
  while (m--) {
    int a, b;
    scanf("%d%d", &a, &b);
    uni(a, b);
  }
  int max_point = 0;
  int ind = 0;
  for (int i = 1; i <= n; i++) {
    int now = fin(i);
    if (flag[now]) {
      if (point[now] > max_point) {
        max_point = point[now];
        ind = now;
      }
    }
  }
  int ans = 0;
  int aa = 0, bb = 0;
  for (int i = 1; i <= n; i++) {
    int now = fin(i);
    if (now == 0)
      continue;
    else if (!flag[now] || now == ind) {
      aa += point[now];
      bb += has[now];
    } else {
      ans += point[now] * (point[now] - 1) / 2 - has[now];
    }
    pre[now] = 0;
  }
  ans += aa * (aa - 1) / 2 - bb;
  printf("%d\n", ans);
  return 0;
}
