#include <bits/stdc++.h>
using namespace std;
const long long N = 1010;
vector<long long> parent(N, -1);
vector<bool> king(N, false);
vector<long long> size(N, -1);
void make_set(long long v) {
  parent[v] = v;
  size[v] = 1;
  king[v] = false;
}
long long find_set(long long v) {
  if (parent[v] == v) return v;
  return parent[v] = find_set(parent[v]);
}
void union_set(long long a, long long b) {
  a = find_set(a);
  b = find_set(b);
  if (a != b) {
    if (size[a] < size[b]) swap(a, b);
    parent[b] = a;
    size[a] += size[b];
    king[a] = king[a] | king[b];
  }
}
signed main() {
  long long n, m, k;
  cin >> n >> m >> k;
  for (long long i = 1; i <= n; i++) make_set(i);
  set<long long> kings;
  for (long long i = 0; i < k; i++) {
    long long x;
    cin >> x;
    king[x] = true;
    kings.insert(x);
  }
  vector<pair<long long, long long>> edges;
  for (long long i = 0; i < m; i++) {
    long long x, y;
    cin >> x >> y;
    edges.push_back({x, y});
    union_set(x, y);
  }
  long long mx_size = 0, id = -1;
  for (auto x : kings) {
    long long par = find_set(x);
    if (size[par] > mx_size) {
      mx_size = size[par];
      id = x;
    }
  }
  for (long long i = 1; i <= n; i++) {
    if (king[find_set(i)] == false) {
      union_set(id, i);
    }
  }
  map<long long, long long> cnt;
  for (long long i = 1; i <= n; i++) cnt[find_set(i)] = 0;
  for (auto z : edges) {
    cnt[find_set(z.first)]++;
  }
  long long ans = 0;
  for (auto z : cnt) {
    long long cur_king = z.first;
    long long set_sz = size[cur_king];
    ans += (set_sz * (set_sz - 1)) / 2 - z.second;
  }
  cout << ans << endl;
  return 0;
}
