#include <bits/stdc++.h>
using namespace std;
template <typename T1, typename T2>
istream& operator>>(istream& in, pair<T1, T2>& a) {
  in >> a.fr >> a.sc;
  return in;
}
template <typename T1, typename T2>
ostream& operator<<(ostream& out, pair<T1, T2> a) {
  out << a.fr << " " << a.sc;
  return out;
}
template <typename T, typename T1>
T amax(T& a, T1 b) {
  if (b > a) a = b;
  return a;
}
template <typename T, typename T1>
T amin(T& a, T1 b) {
  if (b < a) a = b;
  return a;
}
const long long INF = 1e18;
const int32_t MOD = 1e9 + 7;
const int32_t MM = 998244353;
const long long N = 1005;
vector<long long> adj[N];
vector<long long> vis(N, 0), deg(N, 0);
set<long long> s;
long long f, n, m, k, mx = LLONG_MIN, p, edges;
void dfs(long long v) {
  vis[v] = 1;
  edges += deg[v];
  p++;
  if (s.count(v)) f = 0;
  for (auto i : adj[v]) {
    if (!vis[i]) dfs(i);
  }
}
void solve() {
  long long c, u, v, cnt, b, ans = 0;
  b = c = cnt = 0;
  cin >> n >> m >> k;
  for (long long i = 0; i < k; i++) {
    cin >> u;
    s.insert(u);
  }
  for (long long i = 0; i < m; i++) {
    cin >> u >> v;
    adj[u].push_back(v);
    adj[v].push_back(u);
    deg[u]++;
    deg[v]++;
  }
  for (long long i = 1; i <= n; i++) {
    if (!vis[i]) {
      f = 1, p = 0, edges = 0;
      dfs(i);
      if (f) {
        if (b == 1) {
          cnt += p * c;
        }
        c += p;
        b = 1;
      } else
        mx = max(mx, p);
      ans += (p * (p - 1)) / 2 - edges / 2;
    }
  }
  ans += c * mx + cnt;
  cout << ans << '\n';
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long t = 1;
  while (t--) solve();
  return 0;
}
