#include <bits/stdc++.h>
using namespace std;
vector<long long int> graph[1009];
long long int vis[1009], g, cnt, ag, ang_count, ans, c[1009];
void dfs(long long int x) {
  cnt++;
  if (c[x] == 1) g = 1;
  long long int u;
  vis[x] = 1;
  for (long long int i = 0; i < graph[x].size(); i++) {
    u = graph[x][i];
    if (!vis[u]) dfs(u);
  }
  return;
}
signed main() {
  long long int u, v, n, m, k, mxg = 0;
  cin >> n >> m >> k;
  for (long long int i = 0; i < k; i++) cin >> u, c[u] = 1;
  for (long long int i = 0; i < m; i++)
    cin >> u >> v, graph[u].push_back(v), graph[v].push_back(u);
  for (long long int i = 1; i <= n; i++) {
    g = 0, cnt = 0;
    if (!vis[i]) {
      dfs(i);
      if (g)
        ag += (cnt * (cnt - 1)) / 2, mxg = max(mxg, cnt);
      else
        ang_count += cnt;
    }
  }
  cout << ag + (ang_count * (ang_count - 1)) / 2 + mxg * ang_count - m;
  return 0;
}
