#include <bits/stdc++.h>
using namespace std;
vector<int> g[1002];
bool vis[1002];
int cnt_node[1002];
int dfs(int node) {
  if (vis[node]) return 0;
  vis[node] = true;
  int ans = 1;
  for (int i = 0; i < g[node].size(); i++) {
    int nxt = g[node][i];
    ans += dfs(nxt);
  }
  return ans;
}
int main() {
  int n, m, k;
  scanf("%d", &n);
  scanf("%d", &m);
  scanf("%d", &k);
  int c[k];
  for (int i = 0; i < k; i++) scanf("%d", &c[i]);
  for (int i = 0; i < m; i++) {
    int u, v;
    scanf("%d", &u);
    scanf("%d", &v);
    g[u].push_back(v);
    g[v].push_back(u);
  }
  memset(cnt_node, 0, sizeof(cnt_node));
  memset(vis, false, sizeof(vis));
  for (int i = 0; i < k; i++) {
    cnt_node[i] = dfs(c[i]);
  }
  cnt_node[k] = 0;
  for (int i = 1; i <= n; i++) {
    cnt_node[k] += dfs(i);
  }
  int mx = -1;
  int ans = 0;
  for (int i = 0; i < k; i++) {
    mx = max(cnt_node[i], mx);
    ans += cnt_node[i] * (cnt_node[i] - 1) / 2;
  }
  ans -= mx * (mx - 1) / 2;
  cnt_node[k] += mx;
  ans += cnt_node[k] * (cnt_node[k] - 1) / 2;
  ans -= m;
  printf("%d\n", ans);
  return 0;
}
