#include <bits/stdc++.h>
using namespace std;
const long long mod = 1000000007;
const int MAXN = 1000;
vector<int> lst[MAXN];
int parent[MAXN];
void make_set(int v) {
  lst[v] = vector<int>(1, v);
  parent[v] = v;
}
int find_set(int v) { return parent[v]; }
void union_sets(int a, int b) {
  a = find_set(a);
  b = find_set(b);
  if (a != b) {
    if (lst[a].size() < lst[b].size()) swap(a, b);
    while (!lst[b].empty()) {
      int v = lst[b].back();
      lst[b].pop_back();
      parent[v] = a;
      lst[a].push_back(v);
    }
  }
}
int main() {
  int n, m, k;
  scanf("%d %d %d", &n, &m, &k);
  std::vector<int> cap(k);
  for (int i = 0; i < k; i++) scanf("%d", &cap[i]);
  for (int i = 0; i < k; i++) cap[i]--;
  for (int i = 0; i < n; i++) make_set(i);
  for (int i = 0; i < m; i++) {
    int x, y;
    scanf("%d %d", &x, &y);
    x--;
    y--;
    union_sets(x, y);
  }
  long long ans = 0;
  long long fr = n;
  long long mx = 0;
  for (int i = 0; i < k; i++) {
    long long l = lst[find_set(cap[i])].size();
    fr -= l;
    mx = max(mx, l);
    ans += l * (l - 1) / 2;
  }
  ans += fr * (fr - 1) / 2;
  ans += fr * mx;
  ans -= m;
  cout << ans;
}
