local n, m = io.read("*n", "*n")
local edge, len = {}, {}
local taskstate = {}
for i = 1, n do
  edge[i] = {}
  len[i] = 0
  taskstate[i] = false
end
len[1] = 1
taskstate[1] = true

for i = 1, m do
  local a, b = io.read("*n", "*n")
  edge[a][b], edge[b][a] = true, true
end

local tasks = {1}
while 0 < #tasks do
  local src = tasks[#tasks]
  taskstate[src] = false
  table.remove(tasks)
  local f1 = len[src] % 2 == 1
  local f2 = 1 < len[src]
  for dst, _u in pairs(edge[src]) do
    local up = false
    if f1 and len[dst] <= 1 then
      len[dst] = len[dst] + 2
      up = true
    end
    if f2 and len[dst] % 2 == 0 then
      len[dst] = len[dst] + 1
      up = true
    end
    if up and not taskstate[dst] then
      taskstate[dst] = true
      table.insert(tasks, dst)
    end
  end
end
local t1num, t2num = 0, 0
for i = 1, n do
  if len[i] == 1 then
    t1num = t1num + 1
  elseif len[i] == 2 then
    t2num = t2num + 1
  end
end
print(
  math.floor(n * (n - 1) / 2)
  - math.floor(t1num * (t1num - 1) / 2)
  - math.floor(t2num * (t2num - 1) / 2)
  - m
)
