#include <bits/stdc++.h>
using namespace std;
const long long int N = 1e5 + 7;
const long long int M = 1e9 + 9;
long long int n, m, k, x, y;
long long int gov[1005];
long long int a[1005], vist[1005];
std::vector<long long int> adj[1005];
long long int maxi = -1;
long long int val, ed;
void dfs(long long int src) {
  vist[src] = 1;
  val++;
  for (auto x : adj[src]) {
    ed++;
    if (vist[x] == 0) dfs(x);
  }
}
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  cin >> n >> m >> k;
  for (long long int i = 0; i < k; i++) {
    cin >> a[i];
    gov[a[i]] = 1;
  }
  for (long long int i = 0; i < m; i++) {
    cin >> x >> y;
    adj[x].push_back(y);
    adj[y].push_back(x);
  }
  long long int ans = 0;
  for (long long int i = 0; i < k; i++) {
    val = 0;
    ed = 0;
    dfs(a[i]);
    ed = ed / 2;
    ans += ((val * (val - 1)) / 2) - ed;
    maxi = max(val, maxi);
  }
  for (long long int i = 1; i <= n; i++) {
    val = 0;
    ed = 0;
    if (vist[i] == 0) {
      dfs(i);
      ed = ed / 2;
      ans += ((val * (val - 1)) / 2) - ed;
      ans += (maxi * (val));
      maxi += (val);
    }
  }
  cout << ans;
}
