N,M = gets.chomp.split.map(&:to_i)
X = M.times.map{gets.split.map(&:to_i)}
y = 1

g = Array.new(N,0)
m = Array.new(N,0)
m[X[0][0]-1] = 1
g[0] += 1

(0..M-1).each do |i|
  if m[X[i][0]-1] == 0 && m[X[i][1]-1] == 0
    y += 1
    g[y-1] += 2
    m[X[i][0]-1] = y
    m[X[i][1]-1] = y
  else
    if m[X[i][0]-1] == 0
      g[m[X[i][1]-1]-1] += 1
      m[X[i][0]-1] = m[X[i][1]-1]
    end
    if m[X[i][1]-1] == 0
      g[m[X[i][0]-1]-1] += 1
      m[X[i][1]-1] = m[X[i][0]-1]
    end
  end
end

puts g.max
    
  