func_code_string: #include <bits/stdc++.h>   const long double EPS = 1e-10;   const long long int MOD = 1000000007ll;   const long long int mod1 = 1000000009ll;   const long long int mod2 = 1100000009ll;   int INF = (int)1e9;   long long int INFINF = (long long int)1e18;   int debug = 0;   long double PI = acos(-1.0);   using namespace std;   long long int bit_count(long long int _x) {     long long int _ret = 0;     while (_x) {       if (_x % 2 == 1) _ret++;       _x /= 2;     }     return _ret;   }   long long int bit(long long int _mask, long long int _i) {     return (_mask & (1 << _i)) == 0 ? 0 : 1;   }   long long int powermod(long long int _a, long long int _b,                          long long int _m = MOD) {     long long int _r = 1;     while (_b) {       if (_b % 2 == 1) _r = (_r * _a) % _m;       _b /= 2;       _a = (_a * _a) % _m;     }     return _r;   }   long long int add(long long int a, long long int b, long long int m = MOD) {     long long int x = a + b;     while (x >= m) x -= m;     while (x < 0) x += m;     return x;   }   long long int sub(long long int a, long long int b, long long int m = MOD) {     long long int x = a - b;     while (x < 0) x += m;     while (x >= m) x -= m;     return x;   }   long long int mul(long long int a, long long int b, long long int m = MOD) {     long long int x = a * 1ll * b;     x %= m;     if (x < 0) x += m;     return x;   }   int N, M, K;   vector<int> G[1010];   bool spec[1010];   bool vis[1010];   int tot, cnt;   vector<int> sizes;   void dfs(int u) {     tot++;     cnt++;     vis[u] = true;     for (int v : G[u]) {       if (!vis[v]) {         dfs(v);       }     }   }   int main() {     if (0) {       freopen( input.txt ,  r , stdin);       debug = 1;     }     srand(time(NULL));     scanf( %d , &N);     scanf( %d , &M);     scanf( %d , &K);     for (int i = 1; i <= K; i++) {       int x;       scanf( %d , &x);       spec[x] = true;     }     for (int i = 1; i <= M; i++) {       int u, v;       scanf( %d , &u);       scanf( %d , &v);       G[u].push_back(v);       G[v].push_back(u);     }     for (int i = 1; i <= N; i++) {       if (spec[i]) {         cnt = 0;         dfs(i);         sizes.push_back(cnt);       }     }     sort(sizes.begin(), sizes.end());     reverse(sizes.begin(), sizes.end());     sizes[0] += (N - tot);     long long int ans = 0;     for (int it : sizes) {       ans += (it * (it - 1)) / 2;     }     cout << ans - M;     return 0;   }   