#include <bits/stdc++.h>
using namespace std;
list<int> *adj;
bool *que;
int cou;
int flag;
void add(int v, int w) {
  adj[v].push_back(w);
  adj[w].push_back(v);
}
void dfs(int k, bool *visit) {
  visit[k] = true;
  cou++;
  if (que[k] == true) flag = 1;
  std::list<int>::iterator it;
  for (it = adj[k].begin(); it != adj[k].end(); it++) {
    if (visit[*it] == false) dfs(*it, visit);
  }
}
int main() {
  int n, m, k, temp, found = 0;
  cin >> n >> m >> k;
  que = new bool[n];
  for (int i = 0; i < n; i++) que[i] = false;
  for (int i = 1; i <= k; i++) {
    cin >> temp;
    temp--;
    que[temp] = true;
  }
  adj = new list<int>[n];
  int kol, lol;
  for (int i = 1; i <= m; i++) {
    cin >> kol >> lol;
    kol--;
    lol--;
    add(kol, lol);
  }
  bool *visit = new bool[n];
  for (int i = 0; i < n; i++) visit[i] = false;
  long long int ans = 0;
  vector<int> v;
  for (int i = 0; i < n; i++) {
    if (visit[i] == false) {
      cou = 0;
      flag = 0;
      dfs(i, visit);
      if (flag == 0) {
        found = 1;
        ans += cou;
      } else {
        v.push_back(cou);
      }
    }
  }
  sort(v.begin(), v.end());
  std::vector<int>::iterator it;
  it = v.end();
  it--;
  ans += (*it);
  ans = (ans * (ans - 1)) / 2;
  v.erase(it);
  long long int an = 0;
  for (it = v.begin(); it != v.end(); it++) {
    int k = *it;
    an += (k * (k - 1)) / 2;
  }
  ans = ans + an - m;
  cout << ans << endl;
}
