#include <bits/stdc++.h>
using namespace std;
int brute(int argc, char *argv[]) { return 0; }
int tests(int argc, char *argv[]) { return 0; }
int n, m, k;
vector<vector<int> > graph;
vector<int> countries;
bool vis[100005];
bool _countries[100005];
int v = 0;
set<pair<int, int> > edges;
int parent[100005];
vector<int> cur;
void dfs(int x) {
  for (int i = 0; i < graph[x].size(); ++i) {
    int p = min(x, graph[x][i]);
    int q = max(x, graph[x][i]);
    edges.insert(make_pair(p, q));
    if (vis[graph[x][i]] == false) {
      vis[graph[x][i]] = true;
      cur.push_back(graph[x][i]);
      dfs(graph[x][i]);
    }
  }
}
int _main(int argc, char *argv[]) {
  cin >> n >> m >> k;
  int x, y;
  graph.resize(n + 5);
  for (int i = 0; i < k; ++i) {
    scanf("%d", &x);
    _countries[x] = true;
    countries.push_back(x);
  }
  for (int i = 0; i < m; ++i) {
    scanf("%d%d", &x, &y);
    graph[x].push_back(y);
    graph[y].push_back(x);
  }
  long long res = 0;
  long long count = -1;
  long long __max = 0;
  long long sum = 0;
  long long diff = 0;
  for (int i = 1; i <= n; ++i) {
    if (vis[i] == false) {
      vis[i] = true;
      edges.clear();
      cur.clear();
      cur.push_back(i);
      dfs(i);
      int c = -1;
      for (int j = 0; j < cur.size(); ++j) {
        if (_countries[cur[j]]) {
          assert(c == -1);
          c = cur[j];
        }
      }
      if (c == -1) {
        int v = cur.size();
        int e = edges.size();
        sum += v;
        diff += e;
      } else {
        int v = cur.size();
        int e = edges.size();
        long long _max = (v * 1ll * (v - 1)) / 2;
        assert(_max >= e);
        res += (_max - e);
        __max = max(__max, (long long)v);
      }
    }
  }
  res += (sum * (sum - 1)) / 2;
  res -= diff;
  res += (__max * sum);
  cout << res << endl;
  return 0;
}
int main(int argc, char *argv[]) {
  if (argc >= 2 && argv[1][0] == '1') {
    brute(argc, argv);
  } else if (argc >= 2 && argv[1][0] == '2') {
    tests(argc, argv);
  } else {
    _main(argc, argv);
  }
  return 0;
}
