#include <bits/stdc++.h>
using namespace std;
const int MaxN = 1000, MaxM = 2e5;
int n, m, all, K;
int pre[MaxM + 5], last[MaxN + 5], other[MaxM + 5];
int g[MaxN + 5], size[MaxN + 5];
bool vis[MaxN + 5];
void Build(int x, int y) {
  pre[++all] = last[x];
  last[x] = all;
  other[all] = y;
}
void Init() {
  all = -1;
  memset(last, -1, sizeof(last));
  for (int i = 1; i <= K; i++) scanf("%d", &g[i]);
  for (int i = 1; i <= m; i++) {
    int u, v;
    scanf("%d%d", &u, &v);
    Build(u, v);
    Build(v, u);
  }
}
void Dfs(int x, int s) {
  size[s]++;
  vis[x] = true;
  int ed = last[x], dr;
  while (ed != -1) {
    dr = other[ed];
    if (!vis[dr]) Dfs(dr, s);
    ed = pre[ed];
  }
}
void Solve() {
  memset(vis, 0, sizeof(vis));
  memset(size, 0, sizeof(size));
  int MaX = 0, pos = -1;
  for (int i = 1; i <= K; i++) {
    Dfs(g[i], g[i]);
    if (size[g[i]] > MaX) {
      MaX = size[g[i]];
      pos = g[i];
    }
  }
  for (int i = 1; i <= n; i++)
    if (!vis[i]) size[pos]++;
  int ans = 0;
  for (int i = 1; i <= K; i++) ans += size[g[i]] * (size[g[i]] - 1) / 2;
  printf("%d\n", ans - m);
}
int main() {
  while (~scanf("%d%d%d", &n, &m, &K)) {
    Init();
    Solve();
  }
  return 0;
}
