#include <bits/stdc++.h>
using namespace std;
using LL = long long;
struct FastIO {
  FastIO() {
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
  }
} ________________;
const int N = 1100;
int n, m, k, c[N], cnt[N], cntSum = 0, cntMax = -1;
bool was[N];
vector<int> g[N];
int dfs(int v) {
  int ret = 1;
  was[v] = true;
  for (int u : g[v])
    if (!was[u]) ret += dfs(u);
  return ret;
}
int main() {
  cin >> n >> m >> k;
  for (int i = 0; i < k; i++) {
    cin >> c[i];
  }
  for (int j = 0; j < m; j++) {
    int u, v;
    cin >> u >> v;
    g[u].push_back(v);
    g[v].push_back(u);
  }
  LL ans = 0;
  for (int i = 0; i < k; i++) {
    cnt[i] = dfs(c[i]);
    cntSum += cnt[i];
    cntMax = max(cntMax, cnt[i]);
    ans += (cnt[i] * 1ll * (cnt[i] - 1)) / 2ll;
  }
  ans -= (cntMax * 1ll * (cntMax - 1)) / 2ll;
  cntMax += n - cntSum;
  ans += (cntMax * 1ll * (cntMax - 1)) / 2ll;
  ans -= m;
  cout << ans << "\n";
  return 0;
}
