n,m = gets.split.map(&:to_i)

pairs = Array.new(n){Array.new(0)}

for i in 0...m
  tmp = gets.split.map(&:to_i)
  pairs[tmp.min-1].push(tmp.max-1)
  pairs[tmp.max-1].push(tmp.min-1)
end

for i in 0...n
  pairs[i] = pairs[i].uniq.sort
end

#p pairs

group = Array.new(n,nil)
group[0] = 0


=begin
for i in 0...n
  if group[i]==nil
    kouho = i
    for j in pairs[i]
      if group[j]!=nil
        kouho = [kouho,group[j]].min
      end
    end
    group[i] = kouho
  end
  
  for j in pairs[i]
    if group[j]==nil
      group[j] = group[i]
    end
  end
end

ans = 0

group = group.sort

tmp = 1
for i in 1...group.size
  if group[i]==group[i-1]
    tmp += 1
  else
    ans = [ans,tmp].max
    tmp = 1
  end
end

ans = [ans,tmp].max

puts ans
=end

new_arr = Array.new(0)
for i in (0...n).reverse_each
  new_arr.replace(pairs[i])
  for j in pairs[i]
    new_arr = (new_arr | pairs[j])
  end
  pairs[i].replace(new_arr)
end

ans = 0
for i in 0...n
  ans = [ans,pairs[i].size].max
end

puts ans