END { load __FILE__ unless $stdin.eof? }

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

nbrs = Array.new(n + 1) { [] }
m.times do
  u, v = gets.split.map!(&:to_i)
  nbrs[u] << v
  nbrs[v] << u
end

max_num = 0
(1..n).each do |i|
  q = nbrs[i]
  next unless q

  group = { i => true }
  while (j = q.pop)
    r = nbrs[j]
    next unless r
    group[j] = true
    nbrs[j] = nil
    q.concat(r)
  end
  num = group.size
  max_num = num if num > max_num

  nbrs[i] = nil
end

puts max_num
