#!/usr/bin/env ruby
require 'set'

N, M = gets.chomp.split.map(&:to_i)

ab = Set.new

M.times do |i|
  a, b = gets.chomp.split.map(&:to_i)
  a, b = b, a if a > b
  a -= 1
  b -= 1
  ab << [a, b]
end

ab = ab.to_a

ab.sort_by! { |(a, b)| a }

group = {}

ab.each do |(a, b)|
  groupid = group[a] || group[b] || a
  group[a] ||= groupid
  group[b] ||= groupid
end

h = {}

group.each do |_, groupid|
  h[groupid] ||= 0
  h[groupid] += 1
end

puts h.values.max || 1
