#include <bits/stdc++.h>
using namespace std;
const double PI = acos(-1.0);
const long long mod = 1e9 + 7;
long long pows(long long a, long long b) {
  long long res = 1;
  for (long long i = 0; i < b; ++i) {
    res *= a;
  }
  return res;
}
vector<long long> g[1005];
bool vis[1005];
long long power(long long x, unsigned long long y, long long p) {
  long long res = 1;
  x = x % p;
  while (y > 0) {
    if (y & 1) res = (res * x) % p;
    y = y >> 1;
    x = (x * x) % p;
  }
  return res;
}
void init() {
  ios_base::sync_with_stdio(false);
  std::cin.tie(NULL);
}
long long dfs(long long s) {
  long long ans = 1;
  vis[s] = true;
  for (long long i = 0; i < g[s].size(); i++) {
    if (!vis[g[s][i]]) {
      ans += dfs(g[s][i]);
    }
  }
  return ans;
}
void solve() {
  long long n, m, k;
  cin >> n >> m >> k;
  long long arr[k];
  memset(vis, false, sizeof vis);
  for (long long i = 0; i < k; i++) cin >> arr[i];
  long long x, y;
  for (long long i = 0; i < m; i++) {
    cin >> x >> y;
    g[x].push_back(y);
    g[y].push_back(x);
  }
  long long cnt = 0, mx = INT_MIN;
  for (long long i = 0; i < k; i++) {
    long long temp = dfs(arr[i]);
    mx = max(mx, temp);
    cnt += (temp * (temp - 1)) / 2;
  }
  long long temp = 0;
  for (long long i = 1; i < n + 1; i++) {
    if (!vis[i]) temp++;
  }
  cnt += (temp * (temp - 1)) / 2;
  cout << cnt + (mx * temp) - m << endl;
}
int32_t main() {
  long long t = 1;
  clock_t launch = clock();
  while (t--) {
    solve();
  }
  clog << ((long double)(clock() - launch) / CLOCKS_PER_SEC) << "\n";
}
