#include <bits/stdc++.h>
using namespace std;
int s, a[1010];
vector<int> e[1010];
bool v[1010];
void dfs(int k) {
  s++;
  v[k] = 1;
  for (vector<int>::iterator p = e[k].begin(); p != e[k].end(); p++)
    if (!v[*p]) dfs(*p);
}
int main() {
  int n, m, k;
  scanf("%d%d%d", &n, &m, &k);
  for (int i = 1; i <= k; i++) scanf("%d", &a[i]);
  for (int i = 1; i <= m; i++) {
    int first, second;
    scanf("%d%d", &first, &second);
    e[first].push_back(second);
    e[second].push_back(first);
  }
  int ans = 0, ma = 0, res = n;
  memset(v, 0, sizeof(v));
  for (int i = 1; i <= k; i++) {
    s = 0;
    dfs(a[i]);
    ans += s * (s - 1) / 2;
    ma = max(ma, s);
    res -= s;
  }
  ans = ans - ma * (ma - 1) / 2 + (ma + res) * (ma + res - 1) / 2;
  printf("%d\n", ans - m);
  return 0;
}
