#include <bits/stdc++.h>
using namespace std;
vector<int> g[1111];
int c[1111], u[1111];
vector<int> dfs(int v) {
  u[v] = 1;
  vector<int> res = {v};
  for (int to : g[v])
    if (!u[to]) {
      auto x = dfs(to);
      for (int v : x) res.push_back(v);
    }
  return res;
}
int main() {
  int n, m, k, a, b, ans = 0;
  cin >> n >> m >> k;
  for (int i = 0; i < k; ++i) cin >> c[i];
  for (int i = 0; i < m; ++i) {
    cin >> a >> b;
    g[a].push_back(b);
    g[b].push_back(a);
  }
  int mx = 0;
  for (int i = 0; i < k; ++i) {
    auto v = dfs(c[i]);
    mx = max(mx, (int)v.size());
    int cnt = 0, cc = (int)v.size();
    for (int vv : v) cnt += g[vv].size();
    cnt /= 2;
    ans += (cc * (cc - 1)) / 2 - cnt;
  }
  int cc = 0, cnt = 0;
  for (int i = 1; i <= n; ++i) {
    if (u[i] == 0) {
      cnt += g[i].size();
      cc++;
    }
  }
  ans += (cc * (cc - 1)) / 2 - cnt / 2;
  ans += mx * cc;
  cout << ans << "\n";
  return 0;
}
