def change(i, num)
  if $group[i]==nil
    $group[i] = num
  end
  for j in $pairs[i]
    if $group[j]==nil
      change(j, $group[i])
    end
  end
end

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

$pairs = Array.new(n){Array.new(0)}

for i in 0...m
  tmp = gets.split.map(&:to_i)
  $pairs[tmp[0]-1].push(tmp[1]-1)
  $pairs[tmp[1]-1].push(tmp[0]-1)
end

for i in 0...n
  $pairs[i] = $pairs[i].uniq.sort
end

$group = Array.new(n,nil)

for i in 0...n
  change(i, i)
end

ans = 0

$group = $group.sort

tmp = 1
for i in 1...$group.size
  if $group[i]==$group[i-1]
    tmp += 1
  else
    ans = [ans,tmp].max
    tmp = 1
  end
end

ans = [ans,tmp].max

puts ans