#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
typedef long long int lli;

int dfs(int n, vector<vector<int> > &adj, vector<bool> &used){
    if(used[n]){
        return 0;
    }
    used[n] = true;
    int ret = 1;
    for(int i=0; i<(int)adj[n].size(); i++){
        ret += dfs(adj[n][i], adj, used);
    }
    return ret;
}

int main(){
    lli n,m;
    cin >> n >> m;
    vector<vector<int> > adj(n);
    for(int i=0; i<m; i++){
        int a,b;
        cin >> a >> b;
        a--; b--;
        adj[a].push_back(b);
        adj[b].push_back(a);
    }

    vector<bool> used(n, false);
    lli c1 = dfs(0, adj, used);
    lli c2 = dfs(1, adj, used);
    if(c1 < c2) swap(c1, c2);
    c1 += n-c1-c2;
    cout << c1*(c1-1)/2 + c2*(c2-1)/2 -m << endl;
    return 0;
}
