#include <bits/stdc++.h>
using namespace std;
int gov[1005], cnt = 0;
vector<int> adj[1005];
vector<int> kj(1005, 0);
void dfs(int src) {
  cnt++;
  kj[src] = 1;
  for (int i = 0; i < adj[src].size(); i++) {
    int now = adj[src][i];
    if (!kj[now]) dfs(now);
  }
}
int main() {
  int n, m, k;
  cin >> n >> m >> k;
  for (int i = 0; i < k; i++) cin >> gov[i];
  int a, b;
  for (int i = 0; i < m; i++) {
    cin >> a >> b;
    adj[a].push_back(b);
    adj[b].push_back(a);
  }
  int tot = 0, mx = 0, ans = 0;
  for (int i = 0; i < k; i++) {
    cnt = 0;
    dfs(gov[i]);
    tot += cnt;
    mx = max(mx, cnt);
    ans += cnt * (cnt - 1) / 2;
  }
  int x = n - tot + mx;
  ans += x * (x - 1) / 2;
  ans -= mx * (mx - 1) / 2;
  cout << ans - m << endl;
}
