#include <bits/stdc++.h>
using namespace std;
int fa[1005], deg[1005], sz[1005], n;
bool isgov[1005], hasgov[1005];
inline int getfa(int x) { return fa[x] == x ? x : fa[x] = getfa(fa[x]); }
inline void merge(int x, int y) {
  int fx = getfa(x), fy = getfa(y);
  for (int i = 0; i < n; i++)
    if (fa[i] == fy) fa[i] = fx;
}
inline int sum(int x) { return x * (x - 1) >> 1; }
int main() {
  int m, k;
  scanf("%d%d%d", &n, &m, &k);
  for (int i = 0; i < n; i++) fa[i] = i;
  for (int i = 0; i < k; i++) {
    int g;
    scanf("%d", &g);
    isgov[--g] = true;
  }
  while (m--) {
    int x, y;
    scanf("%d%d", &x, &y);
    deg[--x]++, deg[--y]++;
    merge(x, y);
  }
  for (int i = 0; i < n; i++)
    if (isgov[i]) hasgov[fa[i]] = true;
  int first = -1;
  for (int i = 0; i < n; i++)
    if (fa[i] == i && !hasgov[fa[i]]) {
      if (first == -1)
        first = i;
      else
        merge(first, i);
    }
  for (int i = 0; i < n; i++) {
    sz[fa[i]]++;
    if (i != fa[i]) deg[fa[i]] += deg[i];
  }
  int maxs = -1;
  for (int i = 0; i < n; i++)
    if (fa[i] == i && hasgov[i] && sz[i] > maxs) maxs = sz[i];
  int ans = first == -1 ? 0 : maxs * sz[first];
  for (int i = 0; i < n; i++)
    if (fa[i] == i) ans += sum(sz[i]) - (deg[i] >> 1);
  printf("%d\n", ans);
  return 0;
}
