#include <bits/stdc++.h>
using namespace std;
long long mod = 10000000000;
long long gcd(long long a, long long b) {
  if (b == 0)
    return a;
  else
    return gcd(b, a % b);
}
long long fastexp(long long x, long long n) {
  long long result = 1;
  while (n > 0) {
    if (n % 2 == 1) result *= x;
    x *= x;
    n = n / 2;
  }
  return result;
}
long long modularExp(long long x, long long n, long long mod) {
  long long result = 1;
  while (n > 0) {
    if (n % 2 == 1) result = (result * x) % mod;
    x = ((x % mod) * (x % mod)) % mod;
    n = n / 2;
  }
  return (result) % mod;
}
bool isPrime(long long n) {
  for (long long i = 2; i * i <= n; i++)
    if (n % i == 0) return false;
  return true;
}
bool mycomp(pair<long long, long long> &a, pair<long long, long long> &b) {
  if (a.first != b.first)
    return a.first < b.first;
  else
    return a.second < b.second;
}
vector<long long> v[1005], visited(1005);
long long dfs(long long node, long long *sum) {
  visited[node] = 1;
  long long cnter = 0;
  *sum += v[node].size();
  for (auto it : v[node]) {
    if (!visited[it]) cnter += dfs(it, sum);
  }
  return cnter + 1;
}
void solve() {
  long long n, m, k;
  cin >> n >> m >> k;
  vector<long long> cap(k);
  long long i;
  for (i = 0; i < k; i++) cin >> cap[i];
  for (i = 0; i < m; i++) {
    long long x, y;
    cin >> x >> y;
    v[x].push_back(y);
    v[y].push_back(x);
  }
  vector<pair<long long, long long> > pt;
  for (auto it : cap) {
    long long sum = 0;
    long long sz = dfs(it, &sum);
    pt.push_back({sz, sum / 2});
  }
  long long sz = 0, ed = 0;
  for (i = 1; i <= n; i++) {
    if (!visited[i]) {
      long long sum = 0;
      sz += dfs(i, &sum);
      ed += sum / 2;
    }
  }
  sort(pt.rbegin(), pt.rend());
  long long ans = 0;
  for (auto it : pt) {
    long long s1 = ((it.first) * (it.first - 1)) / 2;
    ans += s1 - it.second;
  }
  if (sz) {
    long long e1 = pt[0].first + sz;
    long long s1 = (e1 * (e1 - 1)) / 2;
    long long y = ((pt[0].first) * (pt[0].first - 1)) / 2;
    ans += s1 - y - ed;
  }
  cout << ans;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long t;
  long long i;
  t = 1;
  while (t--) {
    solve();
  }
}
