#include <bits/stdc++.h>
using namespace std;
long long parent[1001];
bool govt[1001];
long long sz[1001];
long long edges[1001];
int root(int i) {
  while (i != parent[i]) {
    i = parent[i];
  }
  return i;
}
void merge(int i, int j) {
  int A = root(i);
  int B = root(j);
  if (sz[A] < sz[B]) {
    parent[A] = B;
    sz[B] += sz[A];
    edges[B] += edges[A];
    edges[B]++;
    govt[B] = govt[A] | govt[B];
  } else {
    parent[B] = A;
    sz[A] += sz[B];
    edges[A] += edges[B];
    edges[A]++;
    govt[A] = govt[A] | govt[B];
  }
}
int main() {
  ios_base::sync_with_stdio(0);
  long long i, n, m, k, x, y;
  cin >> n >> m >> k;
  for (i = 1; i <= n; i++) {
    parent[i] = i;
    sz[i] = 1;
  }
  for (i = 1; i <= k; i++) {
    cin >> x;
    govt[x] = true;
  }
  for (i = 1; i <= m; i++) {
    cin >> x >> y;
    if (root(x) == root(y)) {
      edges[root(x)]++;
    } else {
      merge(x, y);
    }
  }
  long long ans = 0;
  set<long long> second;
  multiset<long long> num;
  for (i = 1; i <= n; i++) {
    long long temp = root(i);
    if (govt[temp]) {
      if (!(second.find(temp) != second.end())) {
        long long val = sz[temp];
        ans += val * (val - 1) / 2 - edges[temp];
        second.insert(temp);
        num.insert(val);
      }
    } else {
      if (!(second.find(temp) != second.end())) {
        long long val = sz[temp];
        ans += val * (val - 1) / 2 - edges[temp];
        second.insert(temp);
      }
    }
  }
  second.clear();
  long long VVAL = 0;
  for (i = 1; i <= n; i++) {
    long long temp = root(i);
    if (!govt[temp]) {
      if (!(second.find(temp) != second.end())) {
        ans += sz[temp] * VVAL;
        VVAL += sz[temp];
        second.insert(temp);
      }
    }
  }
  long long val = *(--num.end());
  cout << ans + val * VVAL << endl;
  return 0;
}
