#include <bits/stdc++.h>
using namespace std;
vector<long long> arr, v[1001];
vector<long long> v1;
vector<pair<long long, pair<long long, long long> > > v2;
long long visit[1001], visit1[1001], ans;
void dfs(long long x, long long &a, long long &b) {
  a++;
  if (find(arr.begin(), arr.end(), x) != arr.end()) b++;
  visit[x] = 1;
  for (auto i : v[x]) {
    if (!visit[i]) {
      dfs(i, a, b);
    }
  }
}
void dfs1(long long x, long long j) {
  visit1[x] = 1;
  ans += (j - 1 - v[x].size());
  for (auto i : v[x]) {
    if (!visit1[i]) dfs1(i, j);
  }
}
int main() {
  long long n, m, k;
  cin >> n >> m >> k;
  for (long long i = 0; i < k; i++) {
    long long z;
    cin >> z;
    arr.push_back(z);
  }
  for (long long i = 1; i <= m; i++) {
    long long x, y;
    cin >> x >> y;
    v[x].push_back(y);
    v[y].push_back(x);
  }
  for (long long i = 1; i <= n; i++) {
    if (!visit[i]) {
      long long a(0), b(0);
      dfs(i, a, b);
      v2.push_back({a, {i, b}});
    }
  }
  sort(v2.begin(), v2.end());
  long long j = v2[v2.size() - 1].first;
  for (auto i : v2) dfs1(i.second.first, i.first);
  long long flag = 0;
  if (v2[v2.size() - 1].second.second == 1) flag = 1;
  ans = ans / 2;
  for (long long i = 0; i < v2.size() - 1; i++) {
    if (flag == 1 and v2[i].second.second == 0) {
      ans += (j * v2[i].first);
      j += v2[i].first;
    } else if (flag == 0) {
      if (v2[i].second.second == 1) flag = 1;
      ans += (j * v2[i].first);
      j += v2[i].first;
    }
  }
  cout << ans;
  return 0;
}
