#include <bits/stdc++.h>
using namespace std;
void anss(long long x, long long t) {
  cout << "Case #" << t << ": " << x << endl;
}
std::vector<int> special, visited;
std::vector<vector<int>> inp;
pair<int, int> dfs(int from) {
  if (visited[from]) return {0, 0};
  visited[from] = 1;
  int cnt = 1, spcl = binary_search(special.begin(), special.end(), from);
  for (int i = 0; i < inp[from].size(); i++) {
    auto ret = dfs(inp[from][i]);
    spcl = spcl || ret.second;
    cnt += ret.first;
  }
  return {cnt, spcl};
}
int solve() {
  int n, m, k;
  cin >> n >> m >> k;
  inp = std::vector<vector<int>>(n + 1, std::vector<int>());
  visited = std::vector<int>(n + 1, 0);
  for (int i = 0; i < k; i++) {
    int x;
    cin >> x;
    special.push_back(x);
  }
  for (int i = 0; i < m; i++) {
    int to, from;
    cin >> to >> from;
    inp[to].push_back(from);
    inp[from].push_back(to);
  }
  std::vector<pair<int, int>> cc;
  for (int i = 1; i <= n; i++) {
    if (!visited[i]) {
      cc.push_back(dfs(i));
    }
  }
  int maxCC = 0, count = 0, ans = 0;
  for (auto el : cc) {
    cerr << "( "
         << "el.first"
         << " , "
         << "el.second"
         << " ) = ( " << (el.first) << " , " << (el.second) << " )\n";
    ;
    if (el.second) {
      maxCC = max(maxCC, el.first);
      ans += (el.first * (el.first - 1)) / 2;
    } else
      count += el.first;
  }
  ans += (count * (count - 1)) / 2;
  ans += count * maxCC;
  return ans - m;
}
int main() {
  time_t startt = clock();
  int t = 1;
  for (int tt = 0; tt < t; tt++) {
    cout << solve();
    cerr << "~ #" << tt << " done! time : "
         << (double)(clock() - startt) * 1000 / CLOCKS_PER_SEC << " ms" << endl;
  }
}
