N,M,*S = $<.read.split.map &:to_i
A = [p]*(N+1)
M.times {|i|
  a,b = S[i+i,2]
  x,y = A[a],A[b]
  if x
    if y
      if x.object_id != y.object_id
        x,y = y,x  if x.size < y.size
        x.merge y
        y.keys.each {A[_1] = x}
      end
    else
      A[b] = x
    end
  elsif y
    A[a] = x = y
  else
    A[a] = x = A[b] = {}
  end
  x[a] = x[b] = 0
}    
p (1..N).map{a=A[_1]||0; a[0] ? 0 : a.size}.max 