#include <bits/stdc++.h>
using namespace std;
const int M = 1010;
vector<int> A[M];
vector<pair<int, int>> S;
int visited[M];
pair<int, int> dfs(int u) {
  visited[u] = true;
  int sum = 0, num = 0;
  for (int i = 0; i < A[u].size(); i++) {
    int v = A[u][i];
    if (!visited[v]) {
      pair<int, int> t = dfs(v);
      sum += t.second;
      num += t.first;
    }
  }
  return make_pair(num + 1, sum + A[u].size());
}
int cap[M];
int main() {
  ios_base::sync_with_stdio(false);
  int i, j, k, n, m, c;
  cin >> n >> m >> c;
  for (i = 0; i < c; i++) cin >> cap[i];
  while (m--) {
    cin >> i >> j;
    A[i].push_back(j);
    A[j].push_back(i);
  }
  memset(visited, false, sizeof visited);
  for (i = 0; i < c; i++) {
    pair<int, int> t = dfs(cap[i]);
    S.push_back(t);
  }
  sort(S.begin(), S.end());
  reverse(S.begin(), S.end());
  for (i = 1; i <= n; i++) {
    if (!visited[i]) {
      pair<int, int> t = dfs(i);
      S[0].first += t.first;
      S[0].second += t.second;
    }
  }
  int sum = 0;
  for (i = 0; i < S.size(); i++) {
    sum += (S[i].first * (S[i].first - 1)) / 2 - S[i].second / 2;
  }
  cout << sum << endl;
  return 0;
}
