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 map = {}
for i = 1, n do
  local r = uf_findroot(i)
  if not map[r] then map[r] = 1
  else map[r] = map[r] + 1
  end
end
local max = 0
for _k, v in pairs(map) do
  max = max < v and v or max
end
print(max)