#include <bits/stdc++.h>
using namespace std;
vector<vector<int>> g;
vector<bool> v;
int c = 0;
void dfs(int nd) {
  v[nd] = true;
  c++;
  for (auto &ch : g[nd]) {
    if (!v[ch]) dfs(ch);
  }
}
int main() {
  int n, m, k;
  long long ans = 0;
  cin >> n >> m >> k;
  vector<int> spec(k);
  v = vector<bool>(n);
  for (auto &i : spec) {
    cin >> i;
    i--;
  }
  g = vector<vector<int>>(n);
  for (int i = 0; i < m; i++) {
    int u, v;
    cin >> u >> v;
    u--;
    v--;
    g[u].push_back(v);
    g[v].push_back(u);
  }
  int maxi = 0;
  int left = n;
  for (auto x : spec) {
    c = 0;
    dfs(x);
    ans += (c * (c - 1)) / 2;
    maxi = max(c, maxi);
    left -= c;
  }
  ans -= (maxi * (maxi - 1)) / 2;
  ans += ((maxi + left) * (maxi + left - 1)) / 2;
  ans -= m;
  cout << ans << endl;
  return 0;
}
