#include <bits/stdc++.h>
using namespace std;
using ll = long long;
vector<bool> used;
vector<vector<int>> g;
int dfs(int v) {
  if (used[v]) return 0;
  used[v] = true;
  int size = 1;
  for (int i = 0; i < g[v].size(); i++) size += dfs(g[v][i]);
  return size;
}
void Solve() {
  int n, m, k;
  scanf("%d%d%d", &n, &m, &k);
  g.assign(n, vector<int>());
  vector<int> c(k);
  for (int i = 0; i < k; i++) {
    scanf("%d", &c[i]);
    c[i]--;
  }
  for (int i = 0; i < m; i++) {
    int u, v;
    scanf("%d%d", &u, &v);
    u--, v--;
    g[u].push_back(v);
    g[v].push_back(u);
  }
  used.assign(n, false);
  int answer = 0;
  int maxsize = 0;
  for (int i = 0; i < k; i++) {
    int size = dfs(c[i]);
    maxsize = max(maxsize, size);
    answer += size * (size - 1) / 2;
  }
  for (int i = 0; i < n; i++) {
    if (!used[i]) {
      int size = dfs(i);
      answer += size * (size - 1) / 2 + size * maxsize;
      maxsize += size;
    }
  }
  printf("%d", answer - m);
}
int main() {
  Solve();
  return 0;
}
