#include <bits/stdc++.h>
using namespace std;
template <typename T>
void print_array(T* arr, int num) {
  for (int i = (0); i < (num); i++) cout << arr[i] << ' ';
  cout << '\n';
}
template <typename T>
void print_vector(vector<T> vec) {
  for (int i = (0); i < (vec.size()); i++) cout << vec[i] << ' ';
  cout << '\n';
}
bitset<1010> spec, chk;
vector<int> arr[1010];
vector<int> sz, nz;
int n, m, k, a, b, num, s;
void dfs(int i, int p) {
  chk[i] = 1;
  if (spec[i]) s = 1;
  for (int x : arr[i]) {
    if (x == p || chk[x]) continue;
    dfs(x, i);
  }
  num++;
}
void dfs() {
  for (int i = (1); i < (n + 1); i++) {
    if (chk[i]) continue;
    chk[i] = 1;
    num = 1;
    s = spec[i];
    for (int x : arr[i]) {
      if (chk[x]) continue;
      dfs(x, i);
    }
    if (s) {
      sz.push_back(num);
      ;
    } else
      nz.push_back(num);
    ;
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cin >> n >> m >> k;
  spec.reset();
  chk.reset();
  for (int i = (0); i < (k); i++) {
    cin >> a;
    spec[a] = 1;
  }
  for (int i = (0); i < (m); i++) {
    cin >> a >> b;
    arr[a].push_back(b);
    ;
    arr[b].push_back(a);
    ;
  }
  dfs();
  int y = *max_element((sz).begin(), (sz).end());
  sz.erase(max_element((sz).begin(), (sz).end()));
  for (int z : nz) y += z;
  int sum = y * (y - 1) / 2;
  for (int z : sz) sum += z * (z - 1) / 2;
  cout << sum - m;
}
