N, M = gets.split.map(&:strip).map(&:to_i)

A = []
B = []

M.times do
  a, b = gets.split.map(&:strip).map(&:to_i)
  A << a
  B << b
end

gs = {}
@dg = {}
g = 0
mn = 1

M.times do |i|
  a = A[i]
  b = B[i]
  if !gs[a]
    if !gs[b]
      g += 1
      gs[a] = g
      gs[b] = g
    else
      gs[a] = gs[b]
    end
  else
    if !gs[b]
      gs[b] = gs[a]
    else
      if gs[a] != gs[b]
        @dg[gs[a]] = gs[b]
        @dg[gs[b]] = gs[a]
      end
    end
  end
end



rg = {}
ng = g
(1..g).each do |g|
  next if rg[g]
  if sg = @dg[g]
    ng += 1
    rg[g] = ng
    while !rg[sg]
      rg[sg] = ng
      sg = @dg[sg]
    end
  else
    rg[g] = g
  end
end

m = 1
c = {}
gs.each do |_, g|
  gg = rg[g]
  c[gg] ||= 0
  c[gg] += 1
  if c[gg] > m
    m = c[gg]
  end
end

puts m
