#include <bits/stdc++.h>
using namespace std;
using ll = int64_t;
using P = pair<ll, ll>;

vector<vector<ll>> edges(1e5);
vector<bool> used(1e5, false);

ll dfs(ll now){
    ll ret = 1;
    used[now] = true;
    for(ll nxt : edges[now]) if(!used[nxt]) ret += dfs(nxt);
    return ret;
}

int main(){
    ll N, M;
    cin >> N >> M;
    for(ll i = 0; i < M; i++){
        ll a, b;
        cin >> a >> b;
        a--;
        b--;
        edges[a].push_back(b);
        edges[b].push_back(a);
    }
    ll num_zero = dfs(0);
    ll num_one = dfs(1);
    ll rest = N - num_zero - num_one;
    (num_zero > num_one ? num_zero : num_one) += rest;
    cout << num_zero * (num_zero - 1) / 2 +
            num_one * (num_one - 1) / 2 - M << endl;
    return 0;
}