#include <bits/stdc++.h>
using namespace std;
const int NMAX = 1005;
int N, M, K;
bool dragnea[NMAX];
vector<int> graph[NMAX];
bitset<NMAX> seen;
vector<int> nodes;
void dfs(int node) {
  nodes.push_back(node);
  seen[node] = 1;
  for (auto& x : graph[node])
    if (seen[x] == 0) dfs(x);
}
vector<int> bad, good;
int main() {
  cin >> N >> M >> K;
  for (int i = 1; i <= K; ++i) {
    int u;
    cin >> u;
    dragnea[u] = true;
  }
  for (int i = 1; i <= M; ++i) {
    int u, v;
    cin >> u >> v;
    graph[u].push_back(v);
    graph[v].push_back(u);
  }
  long long answer = 0;
  for (int i = 1; i <= N; ++i)
    if (seen[i] == 0) {
      nodes.clear();
      dfs(i);
      int cnt = 0;
      bool isdragnea = false;
      for (auto& j : nodes) {
        cnt += graph[j].size();
        if (dragnea[j]) isdragnea = true;
      }
      cnt /= 2;
      int all = 1LL * nodes.size() * (nodes.size() - 1) / 2;
      answer += all - cnt;
      if (isdragnea)
        bad.push_back(nodes.size());
      else
        good.push_back(nodes.size());
    }
  if (!good.empty() && !bad.empty()) {
    int mx = 0;
    for (auto& i : bad) mx = max(mx, i);
    int cnt = good[0];
    for (int i = 1; i < good.size(); ++i) {
      answer += 1LL * cnt * good[i];
      cnt += good[i];
    }
    answer += 1LL * cnt * mx;
  }
  cout << answer << "\n";
  return 0;
}
