#include <bits/stdc++.h>
using namespace std;
bool home[1010], seen[1010];
vector<vector<int>> G;
int main() {
  ios_base::sync_with_stdio(0);
  int n, m, k;
  cin >> n >> m >> k;
  for (int i = 0; i < k; i++) {
    int x;
    cin >> x;
    home[x] = true;
  }
  G = vector<vector<int>>(n + 1);
  for (int i = 0; i < m; i++) {
    int a, b;
    cin >> a >> b;
    G[a].push_back(b);
    G[b].push_back(a);
  }
  int ans = 0, best = -1;
  vector<int> homeless;
  for (int i = 1; i <= n; i++) {
    if (!seen[i]) {
      int nodes = 0, edges = 0;
      bool is_home = false;
      queue<int> q;
      q.push(i);
      seen[i] = true;
      while (!q.empty()) {
        int u = q.front();
        q.pop();
        is_home |= home[u];
        nodes++;
        edges += G[u].size();
        for (auto &v : G[u]) {
          if (!seen[v]) {
            seen[v] = true;
            q.push(v);
          }
        }
      }
      ans += nodes * (nodes - 1) / 2 - edges / 2;
      if (is_home) {
        if (best < nodes) {
          best = nodes;
        }
      } else {
        homeless.push_back(nodes);
      }
    }
  }
  for (int i = 0; i < homeless.size(); i++) {
    ans += homeless[i] * best;
    best += homeless[i];
  }
  cout << ans << "\n";
}
