#include <bits/stdc++.h>
using namespace std;
int n, i, m, k, c[1001], u, t, kt, Max(0), sum(0), g, flag[1001], cnt;
vector<int> v[1001];
void Dfs(int x) {
  flag[x] = 1;
  cnt++;
  for (int j = 0; j < v[x].size(); j++)
    if (flag[v[x][j]] == 0) Dfs(v[x][j]);
}
void Init() {
  cin >> n >> m >> k;
  fill(flag + 1, flag + n + 1, 0);
  for (i = 1; i <= k; i++) cin >> c[i];
  for (i = 1; i <= m; i++) {
    cin >> u >> t;
    v[u].push_back(t);
    v[t].push_back(u);
  }
}
void Solve() {
  for (i = 1; i <= k; i++) {
    cnt = 0;
    Dfs(c[i]);
    Max = max(cnt, Max);
    sum += cnt * (cnt - 1) / 2;
  }
  for (i = 1; i <= n; i++)
    if (flag[i] == 0) g++;
  sum = sum - Max * (Max - 1) / 2 + (Max + g) * (Max + g - 1) / 2;
  cout << sum - m;
}
int main() {
  ios_base ::sync_with_stdio(false);
  cin.tie(NULL);
  Init();
  Solve();
}
