#include <bits/stdc++.h>
using namespace std;
long long exp(long long x, long long y) {
  x %= 1000000007;
  long long res = 1;
  while (y) {
    if (y & 1) res = res * x % 1000000007;
    x = x * x % 1000000007;
    y >>= 1;
  }
  return res;
}
const int maxn = 1005;
vector<vector<int>> adj(maxn);
vector<bool> vis(maxn);
vector<bool> node(maxn);
void dfs(int s) {
  vis[s] = 1;
  node[s] = 1;
  for (auto to : adj[s]) {
    if (!node[to]) {
      dfs(to);
    }
  }
}
int main() {
  long long n, m, k;
  cin >> n >> m >> k;
  vector<long long> v(k);
  for (int i = 0; i <= k - 1; ++i) cin >> v[i];
  for (int i = 1; i <= m; ++i) {
    long long u, v;
    cin >> u >> v;
    adj[u].push_back(v);
    adj[v].push_back(u);
  }
  vector<pair<long long, long long>> num;
  for (int i = 0; i < k; ++i) {
    int s = v[i];
    dfs(s);
    long long edge = 0, sz = 0;
    for (int j = 1; j <= n; ++j) {
      if (vis[j]) {
        ++sz;
        edge += adj[j].size();
      }
    }
    num.push_back({sz, edge});
    vis.assign(maxn, 0);
  }
  long long rem = 0;
  for (int i = 1; i <= n; ++i) {
    if (!node[i]) ++rem;
  }
  sort(num.begin(), num.end());
  reverse(num.begin(), num.end());
  long long ans = 0;
  ans += (num[0].first + rem) * (num[0].first + rem - 1);
  ans -= num[0].second;
  ans /= 2;
  long long minus = 0;
  for (int i = 1; i <= n; ++i) {
    if (!node[i]) minus += adj[i].size();
  }
  ans -= minus / 2;
  for (int i = 1; i < num.size(); ++i) {
    long long mid = (num[i].first) * (num[i].first - 1);
    mid -= num[i].second;
    mid /= 2;
    ans += mid;
  }
  cout << ans;
  return 0;
}
