#include <bits/stdc++.h>
int dx[] = {-1, 0, 1, 0};
int dy[] = {0, 1, 0, -1};
using namespace std;
int vis[1001], vr, e;
int ed[1001][1001];
vector<int> gr[1001];
void dfs(int v, int p) {
  if (vis[v]) return;
  vis[v] = 1;
  vr++;
  for (int j = 0; j < gr[v].size(); j++) {
    int tmp = gr[v][j];
    if (vis[tmp] == 0) {
      dfs(tmp, v);
    }
  }
}
int main() {
  int n, m, k, i, j, s, count = 0, ans = 0, mx = INT_MIN, l, u, v;
  cin >> n >> m >> k;
  int c[k];
  for (i = 0; i < k; i++) {
    cin >> c[i];
  }
  for (i = 0; i < m; i++) {
    cin >> u >> v;
    gr[u - 1].push_back(v - 1);
    gr[v - 1].push_back(u - 1);
  }
  for (i = 0; i < k; i++) {
    vr = 0, e = 0;
    dfs(c[i] - 1, -1);
    ans = ans + (vr * (vr - 1) / 2);
    if (mx < vr) mx = vr;
  }
  vr = 0, e = 0;
  for (i = 0; i < n; i++) {
    if (vis[i] == 0) dfs(i, -1);
  }
  ans = ans + (vr * (vr - 1) / 2);
  ans = ans + (mx * vr);
  ans = ans - m;
  cout << ans << endl;
}
