#include <bits/stdc++.h>
using namespace std;
int n, m, k, ans;
int C[1024], SZ[1024];
vector<int> N[1024], caps;
void go(int from, int gov) {
  for (auto ng : N[from])
    if (C[ng] == 0) {
      C[ng] = gov;
      SZ[gov]++;
      go(ng, gov);
    }
}
int main() {
  cin >> n >> m >> k;
  for (int i = 0; i < k; i++) {
    int c;
    cin >> c;
    C[c] = c;
    caps.push_back(c);
    SZ[c] = 1;
  }
  for (int i = 0; i < m; i++) {
    int u, v;
    cin >> u >> v;
    N[u].push_back(v);
    N[v].push_back(u);
  }
  for (auto c : caps) go(c, c);
  int largest = 0;
  for (auto c : caps) {
    int cur_roads = 0;
    int max_roads = SZ[c] * (SZ[c] - 1) / 2;
    for (int j = 1; j <= n; j++)
      if (C[j] == c) cur_roads += (int)N[j].size();
    ans += max_roads - cur_roads / 2;
    largest = max(largest, SZ[c]);
  }
  int cur_roads_0 = 0;
  for (int j = 1; j <= n; j++)
    if (C[j] == 0) cur_roads_0 += (int)N[j].size();
  ans -= cur_roads_0 / 2;
  for (int i = 1; i <= n; i++)
    if (C[i] == 0) {
      ans += largest;
      largest++;
    }
  cout << ans << endl;
}
