#include <bits/stdc++.h>
using namespace std;
const int MAX_N = 1e3 + 5;
int n, m, k;
int v[MAX_N], e[MAX_N], color[MAX_N], ca[MAX_N];
vector<int> adj[MAX_N];
int dfs(int here, int cid) {
  color[here] = cid;
  int ret = 1;
  for (int there : adj[here]) {
    e[cid]++;
    if (color[there] == -1) {
      ret += dfs(there, cid);
    }
  }
  return ret;
}
int main() {
  scanf("%d %d %d", &n, &m, &k);
  vector<int> c(k + 1);
  for (int i = 1; i <= k; i++) {
    scanf("%d", &c[i]);
  }
  for (int i = 0; i < m; i++) {
    int u, v;
    scanf("%d %d", &u, &v);
    adj[u].push_back(v);
    adj[v].push_back(u);
  }
  memset(color, -1, sizeof(color));
  for (int i = 1; i <= k; i++) {
    v[i] = dfs(c[i], i);
  }
  for (int i = 1; i <= n; i++) {
    if (color[i] == -1) {
      v[0] += dfs(i, 0);
    }
  }
  int sum = 0;
  for (int i = 0; i <= k; i++) {
    ca[i] = (v[i] * (v[i] - 1)) / 2 - e[i] / 2;
    sum += ca[i];
  }
  int ans = 0;
  for (int i = 1; i <= k; i++) {
    ans = max(ans, sum + v[i] * v[0]);
  }
  printf("%d", ans);
  return 0;
}
