
import scala.io.StdIn
import scala.collection.mutable

object Main extends App {
  val Array(n,m)=StdIn.readLine().split(' ').map(_.toInt)
  val eqs=
    for(_ <- 1 to m)yield{
      val Array(n1,n2)=StdIn.readLine().split(' ')
      (n1,n2)
    }

  var eqMap = mutable.Map.empty[String,mutable.IndexedSeq[String]].withDefaultValue(mutable.IndexedSeq.empty[String])
  for((n1,n2) <- eqs){
    eqMap(n1) += n2
    eqMap(n2) += n1
  }
  val elems = mutable.Set((1 to n).map(_.toString): _*)
  var classes = mutable.Set.empty[Set[String]]
  def findClass(elem:String):Unit={
    var cls = mutable.Set.empty[String]
    def inputClassElem(el:String):Unit={
      cls += el
      elems -= el
      for(elOther <-eqMap(el) if !cls(elOther)){
        cls += elOther
        inputClassElem(elOther)
      }
    }
    inputClassElem(elem)
    classes += cls.toSet
  }


  while(!elems.isEmpty){
    findClass(elems.head)
  }
  println(classes.map(_.size).max)

}







