#include <bits/stdc++.h>
using namespace std;
const int N = 200005, S = 2001;
const long long INF = 2e9, MOD = 1e9 + 7;
int n, m, k, s[S], szz, e, ans, ans2, was[S], mx;
vector<int> g[N];
void dfs2(int v) {
  was[v] = 1;
  for (auto j : g[v]) {
    if (!was[j]) {
      dfs2(j);
    }
  }
  szz++;
  e += g[v].size();
}
int sum(int x) { return (x * (x - 1)) / 2; }
int main() {
  cin >> n;
  cin >> m >> k;
  for (int i = 1; i <= k; i++) {
    cin >> s[i];
  }
  for (int i = 1; i <= m; i++) {
    int u, v;
    cin >> u >> v;
    g[v].push_back(u);
    g[u].push_back(v);
  }
  for (int i = 1; i <= k; i++) {
    dfs2(s[i]);
    ans += sum(szz) - e / 2;
    mx = max(szz, mx);
    szz = e = 0;
  }
  for (int i = 1; i <= n; i++) {
    if (!was[i]) {
      dfs2(i);
      ans += szz * mx;
      ans -= e / 2;
      ans2 += szz;
      szz = e = 0;
    }
  }
  ans2 = sum(ans2);
  cout << ans + ans2;
  return 0;
}
