#include <bits/stdc++.h>
using namespace std;
vector<long long> g[1001];
vector<long long> gov;
long long vis[1001];
long long dfs(long long r, long long p) {
  long long ret = 1;
  if (vis[r]) return 0;
  vis[r] = 1;
  for (long long i = 0; i < g[r].size(); i++) {
    long long ch = g[r][i];
    if (ch == p) continue;
    ret += dfs(ch, r);
  }
  return ret;
}
int main() {
  long long n, m, k;
  scanf("%lld", &n);
  scanf("%lld", &m);
  scanf("%lld", &k);
  for (long long i = 1, inp; i <= k; i++) {
    scanf("%lld", &inp);
    gov.push_back(inp);
  }
  for (long long i = 1; i <= m; i++) {
    long long u, v;
    scanf("%lld", &u);
    scanf("%lld", &v);
    g[u].push_back(v);
    g[v].push_back(u);
  }
  long long shomvob = 0;
  long long c = 0;
  for (long long i = 0; i <= k - 1; i++) {
    long long x = dfs(gov[i], -1);
    c = max(x, c);
    shomvob += (x * (x - 1)) / 2;
  }
  long long nvis = 0;
  for (long long i = 1; i <= n; i++) {
    if (vis[i]) continue;
    nvis++;
  }
  nvis += c;
  shomvob = shomvob - (c * (c - 1)) / 2 + (nvis * (nvis - 1)) / 2;
  cout << shomvob - m << endl;
  return 0;
}
