#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, m, k, z, y;
  cin >> n >> m >> k;
  vector<long long> v, adja[n + 1];
  for (long long i = 0; i < k; i++) {
    cin >> z;
    v.push_back(z);
  }
  for (long long i = 0; i < m; i++) {
    cin >> y >> z;
    adja[y].push_back(z);
    adja[z].push_back(y);
  }
  bool visited[n + 1];
  for (long long i = 0; i <= n; i++) visited[i] = 0;
  vector<long long> counts;
  for (long long i = 0; i < v.size(); i++) {
    stack<long long> s;
    visited[v[i]] = 1;
    s.push(v[i]);
    long long count1 = 1;
    while (!s.empty()) {
      long long temp = s.top();
      s.pop();
      for (long long j = 0; j < adja[temp].size(); j++) {
        if (!visited[adja[temp][j]]) {
          s.push(adja[temp][j]);
          count1++;
          visited[adja[temp][j]] = 1;
        }
      }
    }
    counts.push_back(count1);
  }
  sort(counts.begin(), counts.end());
  long long tot = accumulate(counts.begin(), counts.end(), 0);
  long long fsum = 0;
  counts[counts.size() - 1] += n - tot;
  for (long long i = 0; i < counts.size(); i++)
    fsum += counts[i] * (counts[i] - 1) / 2;
  cout << fsum - m << "\n";
  return 0;
}
