import scala.io.StdIn._

object Main extends App {

  val Array(n,m) = readLine().split(" ").map(_.toInt)
  val AB = Array.fill(m)(readLine().split(" ").map(_.toInt-1))
    .map(list => (list(0), list(1)))
  def solve() = {
    val linkMap = (0 until n).map(i => (i -> Set(i))).toMap

    AB.foldLeft((linkMap, 0)) { case ((accMap, maxLink), (a,b)) =>
      val setA = accMap(a)+b
      val setB = accMap(b)+a
      val updatedMap = accMap.updated(a, setA).updated(b, setB)
      val tmpMaxLink = Math.max(setA.size, setB.size)
      (updatedMap, Math.max(maxLink, tmpMaxLink))
    }._2
  }

  println(solve())

}

