#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pll = pair<ll, ll>;
using dd = long double;
namespace {
static bool constexpr dbg = 0;
ll constexpr N = 1.1e3;
ll n, m, k, res, cnt[N];
bool sp[N];
ll dsu[N];
static bool _dsu_init = [] {
  for (ll i = 0; i < (ll)(N); ++i) dsu[i] = i;
  return true;
}();
ll fath(ll i) {
  if (dsu[i] == i) return i;
  return dsu[i] = fath(dsu[i]);
}
void merge(ll x, ll y) {
  ll xx = fath(x), yy = fath(y);
  if (xx == yy) return;
  if (sp[xx])
    dsu[yy] = xx, cnt[xx] += cnt[yy];
  else
    dsu[xx] = yy, cnt[yy] += cnt[xx];
}
void init() {
  cin >> n >> m >> k;
  for (ll _ = 1; _ <= (ll)(k); ++_) {
    ll c;
    cin >> c;
    sp[c] = true;
  }
}
void solve() {
  for (ll i = 1; i <= (ll)(n); ++i) cnt[i] = 1;
  for (ll _ = 1; _ <= (ll)(m); ++_) {
    ll u, v;
    cin >> u >> v;
    merge(u, v);
  }
  vector<ll> v;
  ll sum = 0;
  for (ll i = 1; i <= (ll)(n); ++i) {
    if (sp[i])
      v.push_back(cnt[i]);
    else if (i == fath(i))
      sum += cnt[i];
  }
  sort(v.begin(), v.end());
  v.back() += sum;
  for (auto vv : v) {
    res += vv * (vv - 1) / 2;
  }
  res -= m;
  cout << res;
}
}  // namespace
int main() {
  if (!dbg) {
    std::ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
  }
  cout << fixed << setprecision(20);
  init();
  solve();
  return 0;
}
