#include <bits/stdc++.h>
using namespace std;
void func(void) {
  freopen("input.c", "r", stdin);
  freopen("output.c", "w", stdout);
}
int vis[1002], g[1002], f = 0, co = 0;
long long total = 0;
vector<int> a[1002];
void dfs(int x) {
  vis[x] = 1;
  co++;
  if (g[x]) f = 1;
  int sz = a[x].size();
  total += sz;
  for (int i = 0; i < sz; i++) {
    int v = a[x][i];
    if (!vis[v]) {
      dfs(v);
    }
  }
}
int main() {
  long long n, q, i, j = 0, temp, t, k, ans = 0, sum = 0, cnt = 0, m, fg = 0, x,
                     y, mx = 0, mx1 = 0, mn = 10000000000000000,
                     mn1 = 10000000000000000;
  cin >> n >> m >> k;
  for (i = 0; i < k; i++) {
    cin >> x;
    g[x]++;
  }
  vector<pair<int, int> > p;
  for (i = 0; i < m; i++) {
    cin >> x >> y;
    a[x].push_back(y);
    a[y].push_back(x);
  }
  for (i = 1; i <= n; i++) {
    if (!vis[i]) {
      total = 0;
      f = 0;
      co = 0;
      dfs(i);
      if (f) {
        p.push_back({total / 2, co});
      } else {
        ans += co;
        sum += total / 2;
      }
    }
  }
  mx = 0;
  int sz = p.size();
  for (i = 0; i < sz; i++) {
    int got = p[i].second;
    long long sum1 = ans + got;
    sum1 = (sum1) * (sum1 - 1) / 2;
    sum1 -= p[i].first;
    if (sum1 > mx) {
      mx = sum1 - sum;
      cnt = i;
    }
  }
  long long sum1 = 0;
  for (i = 0; i < sz; i++) {
    if (i != cnt) {
      int v = p[i].second;
      int u = p[i].first;
      v = (v) * (v - 1) / 2;
      sum1 += v - u;
    }
  }
  sum1 += mx;
  cout << sum1 << endl;
  return 0;
}
