#include <bits/stdc++.h>
using namespace std;
map<int, bool> vis;
vector<int> v[20001];
int dp[20001];
int dfs(int x) {
  vis[x] = true;
  dp[x] = 1;
  for (int i = 0; i < v[x].size(); i++) {
    int to = v[x][i];
    if (!vis[to]) {
      dp[x] += dfs(to);
    }
  }
  return dp[x];
}
int main() {
  int n, m, k;
  cin >> n >> m >> k;
  vector<int> kk;
  for (int i = 0; i < k; i++) {
    int x;
    cin >> x;
    kk.push_back(x);
  }
  for (int i = 0; i < m; i++) {
    int a, b;
    cin >> a >> b;
    v[a].push_back(b);
    v[b].push_back(a);
  }
  long long ans = 0;
  for (int i = 0; i < kk.size(); i++) {
    dfs(kk[i]);
    ans += dp[kk[i]] * (dp[kk[i]] - 1) / 2;
  }
  int cnt = 0;
  for (int i = 1; i <= n; i++) {
    if (!vis[i]) {
      cnt++;
    }
  }
  int mx = 0;
  for (int i = 0; i < kk.size(); i++) {
    mx = max(mx, dp[kk[i]]);
  }
  ans -= mx * (mx - 1) / 2;
  mx += cnt;
  ans += mx * (mx - 1) / 2;
  ans -= m;
  cout << ans;
  return 0;
}
