#include <bits/stdc++.h>
using namespace std;
const int MAX_N = 1010;
vector<int> adj[MAX_N];
bool edgePicked[MAX_N][MAX_N] = {0};
pair<int, int> regionCity[MAX_N];
pair<int, int> regionF[MAX_N];
bool vis[MAX_N] = {0};
int n, k, m;
int city[MAX_N];
void dfs(int x, int root) {
  vis[x] = 1;
  regionCity[root].first++;
  for (int i = 0; i < adj[x].size(); i++) {
    if (!edgePicked[x][adj[x][i]]) {
      edgePicked[x][adj[x][i]] = 1;
      edgePicked[adj[x][i]][x] = 1;
      regionCity[root].second++;
    }
    if (!vis[adj[x][i]]) dfs(adj[x][i], root);
  }
}
void process() {
  int res = 0;
  int maxN = 0;
  int st;
  for (int i = 1; i <= k; i++) {
    regionCity[i] = make_pair(0, 0);
    dfs(city[i], i);
    res += (regionCity[i].first * (regionCity[i].first - 1) / 2 -
            regionCity[i].second);
    if (regionCity[i].first > maxN) {
      st = i;
      maxN = regionCity[i].first;
    }
  }
  int rN = n - k;
  int ce = 0;
  for (int i = 1; i <= n; i++)
    for (int j = 0; j < adj[i].size(); j++)
      if (!edgePicked[i][adj[i][j]]) {
        ce++;
        edgePicked[i][adj[i][j]] = edgePicked[adj[i][j]][i] = 1;
      }
  int uu = 0;
  for (int i = 1; i <= n; i++)
    if (!vis[i]) uu++;
  uu += maxN;
  res += (uu * (uu - 1) / 2 - ce -
          (regionCity[st].first * (regionCity[st].first - 1) / 2));
  cout << res;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin >> n >> m >> k;
  for (int i = 1; i <= k; i++) cin >> city[i];
  int u, v;
  for (int i = 1; i <= m; i++) {
    cin >> u >> v;
    adj[u].push_back(v);
    adj[v].push_back(u);
  }
  process();
  return 0;
}
