#include <bits/stdc++.h>
using namespace std;
#pragma GCC optimize("Ofast")
#pragma GCC target("avx,avx2,fma")
bool iseven(long long int n) {
  if ((n & 1) == 0) return true;
  return false;
}
void print(long long int t) { cout << t; }
void print(int t) { cout << t; }
void print(string t) { cout << t; }
void print(char t) { cout << t; }
void print(double t) { cout << t; }
void print(long double t) { cout << t; }
template <class T, class V>
void print(pair<T, V> p);
template <class T>
void print(vector<T> v);
template <class T>
void print(set<T> v);
template <class T, class V>
void print(map<T, V> v);
template <class T>
void print(multiset<T> v);
template <class T, class V>
void print(pair<T, V> p) {
  cout << "{";
  print(p.first);
  cout << ",";
  print(p.second);
  cout << "}";
}
template <class T>
void print(vector<T> v) {
  cout << "[ ";
  for (T i : v) {
    print(i);
    cout << " ";
  }
  cout << "]";
}
template <class T>
void print(set<T> v) {
  cout << "[ ";
  for (T i : v) {
    print(i);
    cout << " ";
  }
  cout << "]";
}
template <class T>
void print(multiset<T> v) {
  cout << "[ ";
  for (T i : v) {
    print(i);
    cout << " ";
  }
  cout << "]";
}
template <class T, class V>
void print(map<T, V> v) {
  cout << "[ ";
  for (auto i : v) {
    print(i);
    cout << " ";
  }
  cout << "]";
}
const long long int maxn = 1005;
long long int n, m, k;
vector<vector<long long int>> arr(maxn);
vector<bool> gov(maxn, 0);
vector<bool> vis(maxn, 0);
long long int currnodes = 0;
long long int curredges = 0;
long long int getchildren(long long int node) {
  long long int children = 0;
  for (long long int child : arr[node]) {
    children++;
  }
  return children;
}
void dfs(long long int node) {
  vis[node] = 1;
  currnodes++;
  curredges += getchildren(node);
  for (long long int child : arr[node]) {
    if (!vis[child]) {
      dfs(child);
    }
  }
}
void solve() {
  cin >> n >> m >> k;
  for (long long int i = 1; i <= k; ++i) {
    long long int a;
    cin >> a;
    gov[a] = 1;
  }
  for (long long int i = 1; i <= m; ++i) {
    long long int u, v;
    cin >> u >> v;
    arr[u].push_back(v);
    arr[v].push_back(u);
  }
  long long int mxcc = 0;
  long long int ans = 0;
  long long int mxnode = 0;
  for (long long int i = 1; i <= n; ++i) {
    if (gov[i]) {
      currnodes = 0;
      dfs(i);
      if (currnodes > mxcc) {
        mxcc = currnodes;
        mxnode = i;
      }
    }
  }
  long long int cnt = 0;
  for (long long int i = 1; i <= n; ++i) {
    if (!vis[i]) {
      arr[mxnode].push_back(i);
      arr[i].push_back(mxnode);
      ans++;
    }
  }
  fill(vis.begin(), vis.end(), 0);
  for (long long int i = 1; i <= n; ++i) {
    if (gov[i]) {
      currnodes = 0;
      curredges = 0;
      dfs(i);
      curredges /= 2;
      long long int temp = currnodes * (currnodes - 1) / 2;
      temp -= curredges;
      ans += temp;
    }
  }
  cout << ans << '\n';
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  solve();
  return 0;
}
