#include <bits/stdc++.h>
using namespace std;
template <typename T>
void printVector(const std::vector<T>& v) {
  cout << "vector\n";
  for (auto& element : v) {
    cout << element << " ";
  }
  cout << "\n";
}
int readInt() {
  int x;
  cin >> x;
  return x;
}
class DSU {
 public:
  explicit DSU(int count) {
    parent.resize(count);
    rank.resize(count);
    for (int i = 0; i < count; ++i) {
      make_set(i);
    }
  }
  void make_set(int vertex) {
    parent[vertex] = vertex;
    rank[vertex] = 0;
  }
  int find_set(int vertex) {
    if (vertex == parent[vertex]) return vertex;
    return parent[vertex] = find_set(parent[vertex]);
  }
  void union_sets(int element_a, int element_b) {
    element_a = find_set(element_a);
    element_b = find_set(element_b);
    if (element_a != element_b) {
      if (rank[element_a] < rank[element_b]) std::swap(element_a, element_b);
      parent[element_b] = element_a;
      if (rank[element_a] == rank[element_b]) ++rank[element_a];
    }
  }

 private:
  std::vector<int> parent;
  std::vector<int> rank;
};
int c_n_2(int x) { return (x * x - x) / 2; }
int main() {
  int n = readInt();
  int m = readInt();
  int k = readInt();
  vector<int> capitals;
  vector<pair<int, int>> edges;
  DSU dsu(n);
  for (int i = 0; i < k; ++i) {
    capitals.push_back(readInt() - 1);
  }
  for (int i = 0; i < m; ++i) {
    edges.push_back(make_pair(readInt() - 1, readInt() - 1));
    dsu.union_sets(edges.back().first, edges.back().second);
  }
  map<int, int> vertex_for_capital;
  set<int> capital_sets;
  map<int, int> cityes_for_capitals;
  for (int capital : capitals) {
    capital_sets.insert(dsu.find_set(capital));
  }
  for (int i = 0; i < n; ++i) {
    int corr_set = dsu.find_set(i);
    if (capital_sets.count(corr_set)) {
      cityes_for_capitals[corr_set] += 1;
    }
  }
  vector<int> republicas_sizes;
  int republic_cityes = 0;
  for (int capital : capitals) {
    republicas_sizes.push_back(cityes_for_capitals[dsu.find_set(capital)]);
    republic_cityes += republicas_sizes.back();
  }
  sort(republicas_sizes.begin(), republicas_sizes.end());
  republicas_sizes[republicas_sizes.size() - 1] += (n - republic_cityes);
  int answer = 0;
  for (int republic_size : republicas_sizes) {
    answer += c_n_2(republic_size);
  }
  cout << answer - m << "\n";
  return 0;
}
