local max = math.max
local min = math.min
--[[ https://www.slideshare.net/iwiwi/ss-3578491 3~18of73 ]]--

--半分の実装のみ(これでも十分早いらしい)
local UFT = {}

---要素数nでpar[]を初期化
function UFT.new(n)
	local obj = {par = {}}
	for i = 1, n do
		obj.par[i] = i
	end
	return setmetatable(obj,{__index = UFT})
end

---木の根を求める
function UFT:find(x)
	if self.par[x] == x then
		-- 根
		return x
	else
		-- 経路圧縮
		self.par[x] = self:find(self.par[x])
		return self.par[x]
	end
end

---xとyが同じ集合に属するか否か
function UFT:same(x, y)
	return self:find(x) == self:find(y)
end

---xとyの属する集合を併合
function UFT:union(x, y)
	x = self:find(x)
	y = self:find(y)
	if x == y then
		return
	end

	self.par[max(x, y)] = min(x, y)
end

--[[ I referred until here. ]]--

local read = io.read

local n, m = read("n", "n")
local uft = UFT.new(n)
for i = 1, m do
	local a_i, b_i = read("n", "n")
	uft:union(a_i, b_i)
end

local is_finded_num_t = {}
for i = 1, n do
	local par_num = uft:find(i)
	if is_finded_num_t[par_num] then
		is_finded_num_t[par_num] = is_finded_num_t[par_num] + 1
	else
		is_finded_num_t[par_num] = 1
	end
end

local uft_par_max = -1
for i = 1, n do
	if is_finded_num_t[i] then
		uft_par_max = max(uft_par_max, is_finded_num_t[i])
	end
end

print(uft_par_max)
