#include <bits/stdc++.h>
using namespace std;
int n, p, m;
vector<vector<int> > g;
vector<char> used;
vector<long long> c, vs, es;
pair<int, int> dfs(int v) {
  used[v] = true;
  pair<int, int> ans(1, (int)g[v].size());
  for (int u : g[v]) {
    if (used[u]) {
      continue;
    }
    pair<int, int> a = dfs(u);
    ans.first += a.first;
    ans.second += a.second;
  }
  return ans;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> m >> p;
  g.resize(n);
  used.resize(n);
  c = vs = es = vector<long long>(p);
  for (int k = 0; k < p; k++) {
    cin >> c[k];
    c[k]--;
  }
  for (int k = 0; k < m; k++) {
    int v, u;
    cin >> v >> u;
    v--;
    u--;
    g[v].push_back(u);
    g[u].push_back(v);
  }
  int i = -1;
  for (int k = 0; k < p; k++) {
    pair<int, int> ans = dfs(c[k]);
    vs[k] = ans.first;
    es[k] = ans.second / 2;
    if (i == -1 || vs[k] > vs[i]) {
      i = k;
    }
  }
  int rem = 0;
  for (int k = 0; k < n; k++) {
    if (!used[k]) {
      pair<int, int> ans = dfs(k);
      vs[i] += ans.first;
      es[i] += ans.second / 2;
    }
  }
  long long ans = 0;
  for (int k = 0; k < p; k++) {
    ans += vs[k] * (vs[k] - 1) / 2 - es[k];
  }
  cout << ans;
  return 0;
}
