#include <bits/stdc++.h>
using namespace std;
const int MX = 1005;
struct Edge {
  int v, nxt;
} edge[MX * MX];
int head[MX], tot, c[MX], E[MX], V[MX], vis[MX];
void add(int u, int v) {
  edge[tot].v = v;
  edge[tot].nxt = head[u];
  head[u] = tot++;
}
void dfs(int u, int &e, int &v) {
  for (int i = head[u]; ~i; i = edge[i].nxt) {
    int vv = edge[i].v;
    e++;
    if (vis[vv]) continue;
    v++;
    vis[vv] = 1;
    dfs(vv, e, v);
  }
}
int main() {
  int n, m, k;
  while (~scanf("%d%d%d", &n, &m, &k)) {
    memset(head, -1, sizeof(head));
    memset(vis, 0, sizeof(vis));
    memset(E, 0, sizeof(E));
    memset(V, 0, sizeof(V));
    tot = 0;
    for (int i = 0; i < k; i++) scanf("%d", &c[i]);
    for (int i = 0; i < m; i++) {
      int u, v;
      scanf("%d%d", &u, &v);
      add(u, v);
      add(v, u);
    }
    int ans = 0, mx = 0, c1 = n, c2 = m;
    for (int i = 0; i < k; i++) {
      int v = c[i];
      vis[v] = 1;
      V[v]++;
      dfs(v, E[v], V[v]);
      c1 -= V[v];
      c2 -= E[v] / 2;
      if (V[mx] < V[v]) mx = v;
      ans += V[v] * (V[v] - 1) / 2 - E[v] / 2;
    }
    ans += (V[mx] + c1) * (V[mx] + c1 - 1) / 2 - c2 - V[mx] * (V[mx] - 1) / 2;
    printf("%d\n", ans);
  }
  return 0;
}
