#include <bits/stdc++.h>
using namespace std;
using ull = unsigned long long;
using ll = long long;
using ld = long double;
using vi = vector<ll>;
using vvi = vector<vi>;
using vb = vector<bool>;
using ii = pair<ll, ll>;
constexpr bool LOG = true;
void Log() {
  if (LOG) cerr << "\n";
}
template <class T, class... S>
void Log(T t, S... s) {
  if (LOG) cerr << t << "\t", Log(s...);
}
pair<ll, bool> dfs(ll u, const vvi &g, vi &done, vi &important) {
  if (done[u]) return {0, false};
  done[u] = true;
  ll size = 1;
  bool capital = important[u] == 1;
  for (auto v : g[u]) {
    if (done[v]) continue;
    auto r = dfs(v, g, done, important);
    size += r.first;
    capital = capital || r.second;
  }
  return {size, capital};
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  ll n, m, k;
  cin >> n >> m >> k;
  vi important(n, 0);
  for (ll i = 0; i < k; ++i) {
    ll u;
    cin >> u;
    --u;
    important[u] = 1;
  }
  vvi g(n);
  for (ll i = 0; i < m; ++i) {
    ll u, v;
    cin >> u >> v;
    --u, --v;
    g[u].push_back(v);
    g[v].push_back(u);
  }
  vi done(n, 0);
  ll free = 0;
  ll ans = 0;
  ll largest = 0;
  for (ll i = 0; i < n; ++i) {
    if (!done[i]) {
      auto r = dfs(i, g, done, important);
      if (r.second) {
        ans += r.first * (r.first - 1) / 2;
        largest = max(largest, r.first);
      } else {
        free += r.first;
      }
    }
  }
  free += largest;
  ans += free * (free - 1) / 2 - largest * (largest - 1) / 2;
  ans -= m;
  cout << ans << endl;
  return 0;
}
