#include <bits/stdc++.h>
using namespace std;
const int MAX_N = 1e3 + 10;
const int MAX_M = 1e5 + 10;
int size[MAX_N];
int connected_comp[MAX_N];
vector<int> adj_mat[MAX_N];
void dfs(int index, int comp) {
  if (connected_comp[index] == 0) {
    connected_comp[index] = comp;
    size[comp]++;
    for (int(i) = 0; (i) < (((int)((adj_mat[index]).size()))); (i)++) {
      if (connected_comp[adj_mat[index][i]] == 0) {
        dfs(adj_mat[index][i], comp);
      }
    }
  }
}
int main() {
  int n, m, k;
  scanf("%d %d %d", &(n), &(m), &(k));
  std::vector<int> home;
  int temp;
  for (int(i) = 0; (i) < (k); (i)++) {
    scanf("%d", &(temp));
    home.push_back(temp);
  }
  int u, v;
  for (int(i) = 0; (i) < (m); (i)++) {
    scanf("%d %d", &(u), &(v));
    adj_mat[u].push_back(v);
    adj_mat[v].push_back(u);
  }
  for (int(i) = 0; (i) < (((int)((home).size()))); (i)++) {
    dfs(home[i], i + 1);
  }
  int num = ((int)((home).size())) + 1;
  for (int i = 1; i <= n; i++) {
    if (connected_comp[i] == 0) {
      dfs(i, num);
      num++;
    }
  }
  int answer = 0;
  for (int i = 1; i <= n; i++) {
    int out_edge = ((int)((adj_mat[i]).size()));
    answer += size[connected_comp[i]] - 1 - out_edge;
  }
  answer /= 2;
  int mx = 0;
  for (int i = 1; i <= ((int)((home).size())); i++)
    mx = ((mx) > (size[i]) ? (mx) : (size[i]));
  for (int i = ((int)((home).size())) + 1; i < num; i++) {
    answer += size[i] * mx;
    mx += size[i];
  }
  cout << answer << endl;
  return 0;
}
