func_code_string: #include <bits/stdc++.h>   using namespace std;   const int maxn = 1e5 + 10;   int num[maxn];   int F[1010];   int fnd(int t) {     if (F[t] == t) return t;     return F[t] = fnd(F[t]);   }   void join(int a, int b) {     int t1 = fnd(a);     int t2 = fnd(b);     if (t1 != t2) F[t1] = t2;   }   int main() {     int n, m, k;     int cap[maxn];     cin >> n >> m >> k;     memset(num, 0, sizeof(num));     memset(F, 0, sizeof(F));     for (int i = 1; i <= n; ++i) F[i] = i;     for (int i = 1; i <= k; ++i) cin >> cap[i];     for (int i = 1, a, b; i <= m; ++i) {       cin >> a >> b;       join(a, b);     }     for (int i = 1; i <= n; ++i) num[fnd(i)]++;     int maxn = 0, lef = n;     int ans = 0;     for (int i = 1; i <= k; ++i) {       num[cap[i]] = num[fnd(cap[i])];       maxn = max(maxn, num[cap[i]]);       lef -= num[cap[i]];       ans += (num[cap[i]] - 1) * (num[cap[i]]) / 2;     }     ans += (lef + maxn) * (lef + maxn - 1) / 2;     ans -= maxn * (maxn - 1) / 2 + m;     cout << ans;     return 0;   }   