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

friend_groups = Array.new(1) { Array.new(n - 1) { false } }
friend_groups[0][0] = true

relations.each do |a, b|
  new_group = true
  friend_groups.each do |group|
    if group[a-1] || group[b-1]
      group[a-1] = true
      group[b-1] = true
      new_group = false
      break
    end
  end

  if new_group
    group = Array.new(n - 1) { false }
    group[a-1] = true
    group[b-1] = true
    friend_groups << group
  end
end

puts friend_groups.map { |group| group.count(true) }.max
