#include <bits/stdc++.h>
using namespace std;
const int MN = 1010;
int a[MN], vis[MN];
vector<int> g[MN];
int dfs(int u) {
  vis[u] = 1;
  int cnt = 0;
  for (int v : g[u])
    if (!vis[v]) cnt += dfs(v);
  return cnt + 1;
}
int f(int x) { return (x * (x - 1)) / 2; }
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  int n, m, k;
  cin >> n >> m >> k;
  for (int i = 0; i < k; i++) cin >> a[i];
  for (int i = 0; i < m; i++) {
    int u, v;
    cin >> u >> v;
    g[u].push_back(v);
    g[v].push_back(u);
  }
  int ans = 0, mx = 0, nv = n;
  for (int i = 0; i < k; i++) {
    int cnt = dfs(a[i]);
    ans += f(cnt);
    mx = max(mx, cnt);
    nv -= cnt;
  }
  ans -= f(mx);
  ans += f(mx + nv);
  ans -= m;
  cout << ans << '\n';
  return 0;
}
