#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int, int>;
struct State {
  int v, cost;
  State(int v, int cost) : v(v), cost(cost) {}
  bool operator<(const State& s) const { return cost < s.cost; }
  bool operator>(const State& s) const { return cost > s.cost; }
};
template <typename T>
void dump_vector(vector<T> vec) {
  for (int i = 0; i < vec.size(); i++) {
    cout << vec[i] << (i < vec.size() - 1 ? " " : "\n");
  }
}
struct union_find {
  std::vector<int> parent;
  int __size;
  union_find(int size_) : parent(size_, -1), __size(size_) {}
  void unite(int x, int y) {
    if ((x = find(x)) != (y = find(y))) {
      if (parent[y] < parent[x]) std::swap(x, y);
      parent[x] += parent[y];
      parent[y] = x;
      __size--;
    }
  }
  bool is_same(int x, int y) { return find(x) == find(y); }
  int find(int x) { return parent[x] < 0 ? x : parent[x] = find(parent[x]); }
  int size(int x) { return -parent[find(x)]; }
  int size() { return __size; }
};
const int MAX_M = 100010;
int u[MAX_M], v[MAX_M];
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int n, m, k;
  cin >> n >> m >> k;
  vector<int> c(k);
  for (int i = 0; i < k; i++) {
    cin >> c[i];
    c[i]--;
  }
  static union_find uf(n);
  for (int i = 0; i < m; i++) {
    cin >> u[i] >> v[i];
    u[i]--;
    v[i]--;
    uf.unite(u[i], v[i]);
  }
  map<int, ll> size, edges;
  ll biggest_country_size = 0;
  for (int i = 0; i < k; i++) {
    size[uf.find(c[i])] = 0;
    biggest_country_size = max(biggest_country_size, (ll)uf.size(c[i]));
  }
  ll x_num = 0;
  for (int v_i = 0; v_i < n; v_i++) {
    int id = uf.find(v_i);
    if (size.find(id) == size.end()) {
      x_num++;
    } else {
      size[id]++;
    }
  }
  ll x_edges = 0;
  for (int i = 0; i < m; i++) {
    int id = uf.find(u[i]);
    if (size.find(id) == size.end()) {
      x_edges++;
    } else {
      edges[id]++;
    }
  }
  ll ans = 0;
  for (auto mapping : size) {
    ans += mapping.second * (mapping.second - 1) / 2;
  }
  for (auto mapping : edges) {
    ans -= mapping.second;
  }
  ans += biggest_country_size * x_num + x_num * (x_num - 1) / 2 - x_edges;
  cout << ans << endl;
  return 0;
}
