#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.precision(10);
  cout << fixed;
  srand(time(0));
  int n, m, k;
  cin >> n >> m >> k;
  long long ans = 0;
  vector<vector<int>> g(n);
  set<int> s;
  for (int i = 0; i < k; i++) {
    int a;
    cin >> a;
    a--;
    s.insert(a);
  }
  for (int i = 0; i < m; i++) {
    int a, b;
    cin >> a >> b;
    a--, b--;
    g[a].push_back(b);
    g[b].push_back(a);
  }
  vector<bool> was(n);
  map<int, vector<int>> mp;
  map<int, bool> d;
  int c = 0;
  function<void(int)> dfs = [&](int u) {
    was[u] = 1;
    if (s.find(u) != s.end()) d[c] = 1;
    mp[c].push_back(u);
    for (auto x : g[u]) {
      if (!was[x]) {
        dfs(x);
      }
    }
  };
  for (int i = 0; i < n; i++) {
    if (!was[i]) {
      c++;
      dfs(i);
    }
  }
  long long e = 0, full = 0;
  int mx = 0, w, sz;
  for (auto x : mp) {
    if (d[x.first]) {
      if (x.second.size() > mx) {
        mx = x.second.size();
        w = x.first;
        sz = x.second.size();
      }
    } else {
      for (auto y : x.second) {
        e += g[y].size();
      }
      full += x.second.size();
    }
  }
  for (auto x : mp[w]) {
    e += g[x].size();
  }
  full += sz;
  assert((int)e % 2 == 0);
  e /= 2;
  ans += full * (full - 1) / 2 - e;
  for (auto x : mp) {
    if (d[x.first] && x.first != w) {
      long long e = 0;
      for (auto y : x.second) {
        e += g[y].size();
      }
      assert((int)e % 2 == 0);
      e /= 2;
      ans += x.second.size() * (x.second.size() - 1) / 2 - e;
    }
  }
  cout << ans;
  return 0;
}
