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