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

groups = [] # number of members
group_map = (1..n).map { nil } # person => group index

m.times do |i|
  a, b = gets.split(' ').map(&:to_i)
  a -= 1
  b -= 1
  g = group_map[a] || group_map[b] || nil
  if g
    groups[g] += 1 unless group_map[a]
    groups[g] += 1 unless group_map[b]
  else
    g = groups.length
    groups << 2
  end
  group_map[a] = g
  group_map[b] = g
end

puts groups.max
