#include <bits/stdc++.h>
using namespace std;
const int M = 1e3 + 5;
vector<int> adj[M];
bool gov[M], mark[M], g;
int edge, num;
pair<int, int> other;
void dfs(int x) {
  if (gov[x]) g = 1;
  mark[x] = 1;
  num++;
  edge += adj[x].size();
  for (int i = 0; i < adj[x].size(); i++) {
    int child = adj[x][i];
    if (!mark[child]) dfs(child);
  }
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n, m, k, x;
  cin >> n >> m >> k;
  for (int i = 0; i < k; i++) cin >> x, gov[x] = 1;
  while (m--) {
    int fi, se;
    cin >> fi >> se;
    adj[fi].push_back(se), adj[se].push_back(fi);
  }
  int M_num = 0, ans = 0;
  for (int i = 1; i <= n; i++)
    if (!mark[i]) {
      g = edge = num = 0;
      dfs(i);
      edge >>= 1;
      if (!g)
        other = make_pair(other.first + num, other.second + edge);
      else
        ans += (((num * (num - 1)) >> 1) - edge), M_num = max(M_num, num);
    }
  num = other.first, edge = other.second;
  ans += (((num * (num - 1)) >> 1) - edge);
  ans += M_num * num;
  cout << ans << endl;
  return 0;
}
