#include <bits/stdc++.h>
using namespace std;
int c[1010];
int csum[1010];
int parent[1010];
vector<int> connected[1010];
void dfs(int now, int p) {
  for (auto next : connected[now]) {
    if (parent[next] != 0) continue;
    parent[next] = p;
    csum[p]++;
    dfs(next, p);
  }
}
int main() {
  int n, m, k;
  scanf("%d %d %d", &n, &m, &k);
  for (int i = 1; i <= k; i++) scanf("%d", &c[i]);
  for (int i = 1; i <= k; i++) {
    csum[c[i]] = 1;
    parent[c[i]] = c[i];
  }
  for (int i = 0; i < m; i++) {
    int a, b;
    scanf("%d %d", &a, &b);
    connected[a].push_back(b);
    connected[b].push_back(a);
  }
  for (int i = 1; i <= k; i++) dfs(c[i], c[i]);
  vector<int> cont;
  for (int i = 1; i <= k; i++) cont.push_back(csum[c[i]]);
  sort(cont.begin(), cont.end());
  for (int i = 1; i <= n; i++) {
    if (parent[i] == 0) cont[cont.size() - 1]++;
  }
  long long int ans = 0;
  for (auto i : cont) ans += i * (i - 1) / 2;
  printf("%lld", ans - m);
}
