#include <bits/stdc++.h>
using namespace std;
const long long N = (long long)(5e5) + 322;
const long long INF = (long long)(1e9);
const long long mod = (long long)(1e9) + 7;
const double eps = 1e-9;
int col[N], n, m, k, c, ans, sz, mx;
vector<int> cap;
bool edge[1111][1111];
void dfs(int x) {
  col[x] = c;
  sz++;
  mx = max(mx, sz);
  for (long long i = 1; i <= n; ++i) {
    if (edge[x][i] && !col[i]) {
      dfs(i);
    }
  }
}
int main() {
  ios_base ::sync_with_stdio(false);
  cin.tie(0);
  cin >> n >> m >> k;
  for (long long i = 1; i <= k; ++i) {
    int x;
    cin >> x;
    cap.push_back(x);
  }
  for (long long i = 1; i <= m; ++i) {
    int x, y;
    cin >> x >> y;
    edge[x][y] = 1;
    edge[y][x] = 1;
  }
  for (auto it : cap) {
    c++;
    sz = 0;
    dfs(it);
  }
  for (long long i = 1; i <= n; ++i) {
    for (long long j = i + 1; j <= n; ++j) {
      if (col[i] == col[j] && !edge[i][j]) ans++;
    }
  }
  for (long long i = 1; i <= n; ++i) {
    if (col[i] == 0) {
      ans += mx;
    }
  }
  cout << ans;
  return 0;
}
