#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5, MOD = 1e9 + 7;
long long n, m, k, a, b, r, s, sum, ans, x[N], c[N], vis[N];
vector<long long> adj[N];
void dfs(int u) {
  vis[u] = 1;
  s++;
  for (auto v : adj[u])
    if (!vis[v]) dfs(v);
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> m >> k;
  for (int i = 0; i < k; i++) cin >> x[i];
  for (int i = 0; i < m; i++) {
    cin >> a >> b;
    adj[a].push_back(b);
    adj[b].push_back(a);
  }
  for (int i = 0; i < k; i++) {
    s = 0;
    dfs(x[i]);
    c[i] = s;
    sum += s;
  }
  r = n - sum;
  sort(c, c + k);
  c[k - 1] += r;
  for (int i = 0; i < k; i++) ans += c[i] * (c[i] - 1) / 2;
  cout << ans - m << endl;
  return 0;
}
