#include <bits/stdc++.h>
using namespace std;
long long n, m, i, j, k, w;
long long arr[1005], vis[1005];
map<long long, long long> mp;
vector<long long> vec, v[1005];
long long cnt, edges, totver, totedges, mx, ans;
void dfs(long long idx) {
  vis[idx] = 1;
  cnt++;
  for (long long i = 0; i < v[idx].size(); i++) {
    edges++;
    if (!vis[v[idx][i]]) dfs(v[idx][i]);
  }
}
int main() {
  ios::sync_with_stdio(false);
  cin >> n >> m >> k;
  for (i = 0; i < k; i++) cin >> arr[i];
  for (i = 0; i < m; i++) {
    long long x, y;
    cin >> x >> y;
    v[x].push_back(y);
    v[y].push_back(x);
  }
  for (i = 0; i < k; i++) {
    cnt = 0;
    edges = 0;
    dfs(arr[i]);
    totver += cnt;
    totedges += edges / 2;
    ans += (cnt * (cnt - 1)) / 2 - edges / 2;
    mx = max(mx, cnt);
  }
  cnt = n - totver;
  ans += (cnt * (cnt - 1)) / 2 - (m - totedges);
  ans += cnt * mx;
  cout << ans;
  return 0;
}
