#include <bits/stdc++.h>
using namespace std;
const int maxn = 1005;
const int maxm = 2e5 + 5;
struct EDGE {
  int to, next;
  EDGE() {}
  EDGE(int to, int next) : to(to), next(next) {}
} edge[maxm * 2];
int head[maxn], edgecnt;
void init() {
  memset(head, -1, sizeof(head));
  edgecnt = 0;
}
void add(int s, int t) {
  edge[edgecnt] = EDGE(t, head[s]);
  head[s] = edgecnt++;
}
bool f[maxn];
void dfs(int u, int fa, int &vt) {
  f[u] = 1;
  vt++;
  for (int i = head[u]; ~i; i = edge[i].next) {
    int v = edge[i].to;
    if (v == fa) continue;
    if (!f[v]) dfs(v, u, vt);
  }
}
int ct[maxn];
int num[maxn];
int main() {
  int n, m, k;
  scanf("%d %d %d", &n, &m, &k);
  for (int i = 1; i <= k; i++) scanf("%d", &ct[i]);
  init();
  for (int i = 1; i <= m; i++) {
    int s, t;
    scanf("%d %d", &s, &t);
    add(s, t);
    add(t, s);
  }
  int idx = 0;
  for (int i = 1; i <= k; i++) {
    dfs(ct[i], 0, num[i]);
    if (num[i] > num[idx]) idx = i;
  }
  for (int i = 1; i <= n; i++)
    if (!f[i]) {
      int vt = 0;
      dfs(i, 0, vt);
      num[idx] += vt;
    }
  int ret = 0;
  for (int i = 1; i <= k; i++) ret += num[i] * (num[i] - 1) / 2;
  ret -= m;
  printf("%d\n", ret);
  return 0;
}
