def bfs(i)
  q = [i]
  m = 0
  while q != []
    f = q.first
    if $m[f]
      $m[f].each do |val|
        if $check[val] == 0
          q.push(val)
          $check[val] = 1
          m += 1
        end
      end
    end
    q.shift
  end
  return m
end
ma = 1

N, M = gets.split(" ").map(&:to_i)
$m = [[]]
$check = [0] * (N+1)
M.times do
  a, b = gets.split(" ").map(&:to_i)
  if $m[a]
    $m[a].push(b)
  else
    $m[a] = [b]
  end
  if $m[b]
    $m[b].push(a)
  else
    $m[b] = [a]
  end
end
1.upto(N) do |i|
  if $check[i] == 0
    ma = [ma, bfs(i)].max
  end
end
puts ma