#include <bits/stdc++.h>
using namespace std;
vector<bool> isCapital;
struct A {
  int capital;
  int amount;
};
int dfs2(int index, vector<vector<int>>& graph, vector<int>& passed,
         int amount) {
  if (passed[index]) {
    return 0;
  }
  passed[index] = true;
  int sum = 0;
  for (int i = 0; i < graph[index].size(); ++i) {
    sum += dfs2(graph[index][i], graph, passed, amount);
  }
  sum += amount - 1 - graph[index].size();
  return sum;
}
pair<int, int> dfs(int index, vector<vector<int>>& graph, vector<int>& passed,
                   int capital = -1) {
  pair<int, int> curr = {capital, 0};
  if (passed[index]) {
    return curr;
  }
  passed[index] = true;
  curr.second++;
  if (isCapital[index]) {
    curr.first = index;
  }
  for (int i = 0; i < graph[index].size(); ++i) {
    auto t = dfs(graph[index][i], graph, passed, curr.first);
    curr.second += t.second;
    if (curr.first == -1) {
      curr.first = t.first;
    }
  }
  return curr;
}
int main() {
  int n, m, k;
  cin >> n >> m >> k;
  isCapital.resize(n);
  for (int i = 0; i < k; ++i) {
    int temp;
    cin >> temp;
    --temp;
    isCapital[temp] = true;
  }
  vector<vector<int>> graph(n);
  for (int i = 0; i < m; ++i) {
    int a, b;
    cin >> a >> b;
    --a;
    --b;
    graph[a].push_back(b);
    graph[b].push_back(a);
  }
  vector<int> passed(n), passed2(n);
  int none = 0;
  int sum = 0, maxAmount = 0;
  for (int i = 0; i < n; ++i) {
    if (!passed[i]) {
      auto res = dfs(i, graph, passed);
      sum += dfs2(i, graph, passed2, res.second) / 2;
      if (res.first == -1) {
        sum += none * res.second;
        none += res.second;
      } else {
        maxAmount = max(maxAmount, res.second);
      }
    }
  }
  sum += maxAmount * none;
  cout << sum << endl;
}
