#include <bits/stdc++.h>
using namespace std;
const int N = 1e3 + 10;
int a[N], sp[N], deg[N], vis[N], n1, t, ra, ya, ans, mx;
vector<int> nei[N];
void dfs(int v) {
  vis[v] = 1;
  ra++;
  ya += nei[v].size();
  for (int u : nei[v]) {
    if (!vis[u]) dfs(u);
  }
}
int main() {
  int n, m, k;
  cin >> n >> m >> k;
  for (int i = 0; i < k; i++) cin >> sp[i];
  for (int i = 0; i < m; i++) {
    int u, v;
    cin >> u >> v;
    nei[u].push_back(v), nei[v].push_back(u);
    deg[u]++, deg[v]++;
  }
  for (int i = 0; i < k; i++) {
    ra = 0, ya = 0;
    dfs(sp[i]);
    ans += (ra * (ra - 1) - ya) / 2;
    mx = max(mx, ra);
  }
  for (int i = 1; i <= n; i++) {
    ra = 0, ya = 0;
    if (!vis[i]) {
      dfs(i);
      ans += (ra * (ra - 1) - ya) / 2 + (mx * ra);
      mx += ra;
    }
  }
  cout << ans;
}
