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

arr = Array.new(n+1){|i| i}
hash = Array.new(n+1, 1)

m.times do
  a, b = gets.split(" ").map(&:to_i)

  tmp = a
  a_ind = arr[a]
  while tmp != a_ind
    tmp = a_ind
    a_ind = arr[a_ind]
  end

  tmp = b
  b_ind = arr[b]
  while tmp != b_ind
    tmp = b_ind
    b_ind = arr[b_ind]
  end
  
  min_ind = [a_ind, b_ind].min
  arr[a] = min_ind
  arr[b] = min_ind
  next if a_ind == b_ind

  sum = hash[a_ind] + hash[b_ind]
  hash[min_ind] = sum
end

puts hash.max
