def nxt(i)
  tar = $m[i]
  return nil unless tar
  tar.each do |val|
    if $check[val] == 0
      return val
    end
  end
  return nil
end

def dfs(i)
  stk = [i]
  m = 0
  while stk != []
    l = stk.last
    nxt = nxt(l)
    if nxt
      stk.push(nxt)
      $check[nxt] = 1
      m += 1
    else
      stk.pop
    end
  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, dfs(i)].max
  end
end
puts ma