N,M,*P = $<.read.split.map &:to_i
A = (0..N).map {[]}
m = 0
P.each_slice(2) {|a,b| A[a] << b; A[b] << a }
1.upto(N) {|i|
  next  if (a=A[i]).frozen?
  until a.empty?
    a.pop(N).each {|j|
      next  if (b=A[j]).frozen?
      a.concat b
      A[j] = i
    }
  end
}
p A[1,N].tally.values.max