#include <bits/stdc++.h>
static long long solve(const std::vector<std::vector<int> > &g,
                       const std::vector<bool> &c) {
  std::vector<long> edges;
  std::vector<bool> free;
  std::vector<int> size;
  size.reserve(g.size());
  edges.reserve(g.size());
  free.reserve(g.size());
  std::vector<bool> visited(g.size(), false);
  for (int i = 0; i != (int)g.size(); ++i) {
    if (visited[i]) continue;
    std::stack<int> st;
    st.push(i);
    visited[i] = true;
    edges.push_back(0);
    size.push_back(1);
    free.push_back(!c[i]);
    while (!st.empty()) {
      const int u = st.top();
      st.pop();
      edges.back() += g[u].size();
      for (int j = 0; j != (int)g[u].size(); ++j) {
        const int v = g[u][j];
        if (visited[v]) continue;
        st.push(v);
        visited[v] = true;
        ++size.back();
        free.back() = !c[v] && free.back();
      }
    }
  }
  long long ans = 0;
  for (int i = 0; i != (int)size.size(); ++i)
    ans += ((long)size[i] * (size[i] - 1) - edges[i]) / 2;
  int max = 0;
  int count = 0;
  for (int i = 0; i != (int)free.size(); ++i) {
    if (free[i]) {
      ans += (long)count * size[i];
      count += size[i];
    } else {
      max = std::max(max, size[i]);
    }
  }
  ans += count * max;
  return ans;
}
int main() {
  std::ios_base::sync_with_stdio(false);
  long n, m, k;
  std::cin >> n >> m >> k;
  std::vector<bool> c(n);
  for (long i = 0; i != k; ++i) {
    int x;
    std::cin >> x;
    c[x - 1] = true;
  }
  std::vector<std::vector<int> > g(n);
  for (long i = 0; i != m; ++i) {
    int u, v;
    std::cin >> u >> v;
    g[u - 1].push_back(v - 1);
    g[v - 1].push_back(u - 1);
  }
  std::cout << solve(g, c) << "\n";
  return 0;
}
