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

arr = []
hash = {}

m.times do
  a, b = gets.split(" ").map(&:to_i)
  if arr[a].nil?
    hash[a] = Set.new([a])
    arr[a] = a
  end
  if arr[b].nil?
    hash[b] = Set.new([b])
    arr[b] = b
  end
  a_ind = arr[a]
  b_ind = arr[b]
  hash[a_ind].merge(hash[b_ind])
  hash.delete(b_ind)
  arr[b] = a_ind
end

max = 0
hash.each do |_k, v|
  l = v.length
  max = l if max < l 
end

puts max
