#include <bits/stdc++.h>
using namespace std;
const int maxn = 1010;
const int base = 31337;
const int mod = 1e9 + 7;
const int inf = 0x3f3f3f3f;
const int logo = 20;
const int off = 1 << logo;
const int treesiz = off << 1;
int n, m, k;
vector<int> graph[maxn];
int a[maxn], ss[maxn], cs[maxn];
bool bio[maxn];
int cnt = 0;
int dfs(int x) {
  bio[x] = true;
  cnt += graph[x].size();
  int out = 1;
  for (int i = 0; i < graph[x].size(); i++) {
    int tren = graph[x][i];
    if (!bio[tren]) out += dfs(tren);
  }
  return out;
}
int main() {
  scanf("%d%d%d", &n, &m, &k);
  for (int i = 0; i < k; i++) scanf("%d", a + i);
  for (int i = 0; i < m; i++) {
    int a, b;
    scanf("%d%d", &a, &b);
    graph[a].push_back(b);
    graph[b].push_back(a);
  }
  memset(bio, false, sizeof bio);
  int maxi = 0;
  for (int i = 0; i < k; i++) {
    ss[i] = dfs(a[i]);
    maxi = max(maxi, ss[i]);
    cs[i] = cnt / 2, cnt = 0;
  }
  int ax = 0;
  for (int i = 1; i <= n; i++) {
    if (!bio[i]) ax += dfs(i);
  }
  long long tren = 0;
  long long sol = 0;
  for (int i = 0; i < k; i++) {
    tren += ss[i] * (ss[i] - 1) / 2 - cs[i];
  }
  cnt /= 2;
  for (int i = 0; i < k; i++) {
    int pt = a[i];
    int ts = ss[i] + ax;
    sol = max(sol, tren - (ss[i] * (ss[i] - 1) / 2 - cs[i]) +
                       (ts * (ts - 1) / 2 - cnt - cs[i]));
  }
  printf("%lld\n", sol);
  return 0;
}
