#include <bits/stdc++.h>
using namespace std;
const int N = 1005;
int ks[N], a[100005], b[100005];
vector<int> g[N];
int seen[N], ty[N];
void dfs(int i, int p, int t) {
  seen[i] = 1;
  ty[t]++;
  for (int j : g[i]) {
    if (seen[j] == -1 && j != p) {
      dfs(j, i, t);
    }
  }
}
int main() {
  std::ios::sync_with_stdio(false);
  memset(seen, -1, sizeof(seen));
  memset(ty, 0, sizeof(ty));
  int n, m, k;
  cin >> n >> m >> k;
  for (int i = 0; i < k; ++i) {
    cin >> ks[i];
    ks[i]--;
  }
  for (int i = 0; i < m; ++i) {
    int u, v;
    cin >> u >> v;
    --u;
    --v;
    g[u].push_back(v);
    g[v].push_back(u);
  }
  int max = -1, maxk = -1;
  for (int i = 0; i < k; ++i) {
    dfs(ks[i], -1, ks[i]);
    if (max < ty[ks[i]]) {
      maxk = ks[i];
      max = ty[ks[i]];
    }
  }
  for (int i = 0; i < n; ++i) {
    if (seen[i] == -1) {
      dfs(i, -1, maxk);
    }
  }
  long long res = -m;
  for (int i = 0; i < k; ++i) {
    long long tmp = ty[ks[i]];
    res += ((tmp * (tmp - 1)) / 2);
  }
  cout << res << endl;
  return 0;
}
