n, m = gets.split.map(&:to_i)
relations = []
m.times do
  relations << gets.split.map(&:to_i)
end

friend_groups = [[1]]

relations.each do |a, b|
  friend_groups.each do |group|
    if group.any?(a) || group.any?(b)
      group << a
      group << b
    else
      friend_groups << [a, b]
    end
  end
end
puts friend_groups.map { |group| group.uniq.size }.max

