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

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

num = 0

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

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

group = Array.new(n,nil)
group[0] = 0

for i in 0...n
  if group[i]==nil
    kouho = i
    for j in pairs[i]
      if group[j]!=nil
        kouho = [kouho,group[j]].min
      end
    end
    group[i] = kouho
  end
  
  for j in pairs[i]
    if group[j]==nil
      group[j] = group[i]
    end
  end
end

ans = 0

for i in group.uniq
  tmp = 0
  for j in group
    if i==j
      tmp += 1
    end
  end
  ans = [ans,tmp].max
end
puts ans