(n,m)=gets.split.map(&:to_i)
friend_list = ARGF.map{|s|s.split.map(&:to_i).sort}.sort.uniq

tmp=(0..n).to_a
friend_list.each{|a,b|
    x = [tmp[a],tmp[b]].min
    tmp[a] = x
    tmp[b] = x
}
#p friend_list
#p tmp

p tmp.each_with_object([0]*(n+1)){|i,memo|memo[i]+=1}.max