#include <bits/stdc++.h>
using namespace std;
vector<vector<int> > adj(1007);
int vis[1007], nodes = 0, edges = 0, govt[1007];
int v[1007], e[1007];
void dfs(int node) {
  int len = adj[node].size();
  for (int i = 0; i < len; i++) {
    edges++;
    if (vis[adj[node][i]] == 0) {
      nodes++;
      vis[adj[node][i]] = 1;
      dfs(adj[node][i]);
    }
  }
  return;
}
int main() {
  int n, m, k;
  cin >> n >> m >> k;
  for (int i = 0; i < k; i++) {
    int node;
    cin >> node;
    govt[node] = 1;
  }
  for (int i = 0; i < m; i++) {
    int x, y;
    cin >> x >> y;
    adj[x].push_back(y);
    adj[y].push_back(x);
  }
  for (int i = 1; i <= n; i++) {
    if (govt[i] == 1) {
      nodes = 1;
      edges = 0;
      vis[i] = 1;
      dfs(i);
      v[i] = nodes;
      e[i] = edges / 2;
    }
  }
  for (int i = 1; i <= n; i++) {
    if (!vis[i]) {
      vis[i] = 1;
      nodes = 1;
      edges = 0;
      dfs(i);
      v[i] = nodes;
      e[i] = edges / 2;
    }
  }
  int additional = 0, mx = 0, pos = 0;
  for (int i = 1; i <= n; i++) {
    if (v[i]) {
      if (govt[i] and mx < v[i]) mx = v[i], pos = i;
      additional += (v[i] * (v[i] - 1) / 2 - e[i]);
    }
  }
  for (int i = 1; i <= n; i++) {
    if (v[i] and !govt[i]) {
      additional += mx * v[i];
      mx += v[i];
    }
  }
  cout << additional << endl;
  return 0;
}
