local n, m = io.read("*n", "*n")
local parent = {}
for i = 1, n do
  parent[i] = i
end

local function uf_findroot(idx)
  local idx_update = idx
  while parent[idx] ~= idx do
    idx = parent[idx]
  end
  while parent[idx_update] ~= idx do
    parent[idx_update], idx_update = idx, parent[idx_update]
  end
  return idx
end

for i = 1, m do
  local a, b = io.read("*n", "*n")
  local ra, rb = uf_findroot(a), uf_findroot(b)
  parent[rb], parent[b] = ra, ra
end
local groups = {}
local g1 = uf_findroot(1)
local g2 = uf_findroot(2)
groups[g1] = 1
groups[g2] = 1
for i = 3, n do
  local g = uf_findroot(i)
  if not groups[g] then groups[g] = 1
  else groups[g] = groups[g] + 1
  end
end
local c1, c2 = groups[g1], groups[g2]
local rem = 0
for k, v in pairs(groups) do
  if k ~= g1 and k ~= g2 then
    rem = rem + v
  end
end
if c1 < c2 then
  c2 = c2 + rem
else
  c1 = c1 + rem
end
print(math.floor(c1 * (c1 - 1) / 2) + math.floor(c2 * (c2 - 1) / 2) - m)
