#include <bits/stdc++.h>
using namespace std;
vector<long long int> adj[300005];
vector<bool> vis(300005, false);
long long int c, edge;
void dfs(long long int s) {
  c++;
  edge += adj[s].size();
  vis[s] = true;
  for (long long int x : adj[s]) {
    if (!vis[x]) dfs(x);
  }
}
void solve() {
  long long int n, m, k;
  cin >> n >> m >> k;
  vector<long long int> a(k);
  for (long long int i = 0; i < k; i++) cin >> a[i];
  for (long long int i = 0; i < m; i++) {
    long long int u, v;
    cin >> u >> v;
    adj[u].push_back(v);
    adj[v].push_back(u);
  }
  long long int ans = 0, e = 0;
  long long int ms = 0;
  for (long long int i = 0; i < k; i++) {
    c = 0;
    edge = 0;
    dfs(a[i]);
    e += edge / 2;
    ms = max(ms, c);
    ans += (c * (c - 1)) / 2 - edge / 2;
  }
  long long int x;
  x = 0;
  for (long long int i = 1; i < n + 1; i++) x += !vis[i];
  ans += (x * (x - 1)) / 2 - (m - e);
  ans += ms * x;
  cout << ans;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long int t;
  t = 1;
  while (t--) {
    solve();
  }
  return 0;
}
