import std.stdio, std.string, std.conv, std.algorithm, std.numeric;
import std.range, std.array, std.math, std.typecons, std.container, core.bitop;

void main() {
    int n, m;
    scan(n, m);

    auto uf = UnionFind(n);

    foreach (i ; 0 .. m) {
        int ai, bi;
        scan(ai, bi);
        ai--, bi--;
        uf.unite(ai, bi);
    }

    long a = uf.count_node(0), b = uf.count_node(1);
    a = min(a, b);

    long ans = a * (a - 1) / 2 + (n - a) * (n - a - 1) / 2 - m;

    writeln(ans);
}


struct UnionFind {
    private {
        int N;
        int[] p;
        int[] rank;
        int[] num_v;
    }

    this (int n) {
        N = n;
        p = iota(N).array;
        rank = new int[](N);
        num_v = new int[](N);
        foreach (i ; 0 .. N) {
            num_v[i] = 1;
        }
    }

    int find_root(int x) {
        if (p[x] != x) {
            p[x] = find_root(p[x]);
        }

        return p[x];
    }

    bool same(int x, int y) {
        return find_root(x) == find_root(y);
    }

    void unite(int x, int y) {
        int u = find_root(x), v = find_root(y);

        if (u == v) return;

        if (rank[u] < rank[v]) {
            p[u] = v;
            num_v[v] += num_v[u];
            num_v[u] = 0;
        }
        else {
            p[v] = u;
            num_v[u] += num_v[v];
            num_v[v] = 0;

            if (rank[u] == rank[v]) {
                rank[u]++;
            }
        }
    }

    int count_node(int x) {
        return num_v[find_root(x)];
    }
}


void scan(T...)(ref T args) {
    string[] line = readln.split;
    foreach (ref arg; args) {
        arg = line.front.to!(typeof(arg));
        line.popFront();
    }
    assert(line.empty);
}


void fillAll(R, T)(ref R arr, T value) {
    static if (is(typeof(arr[] = value))) {
        arr[] = value;
    }
    else {
        foreach (ref e; arr) {
            fillAll(e, value);
        }
    }
}