package abc177.d

import scala.annotation.tailrec

object Main extends App {
  val sc = new Scanner
  val N, M = sc.nextInt
  val ABs = Vector.fill(M)((sc.nextInt - 1, sc.nextInt - 1))
  val set = Array.range(0, N).map(x => Set(x))
  ABs.foreach { case (a, b) =>
    val t = set(a) ++ set(b)
    set.update(a, t)
    set.update(b, t)
  }
  val ans = set.map(_.size).max
  println(ans)
}

// https://qiita.com/p_shiki37/items/a0f6aac33bf60f5f65e4
object Scanner {
  private def isPrintableChar(c: Int) = 33 <= c && c <= 126
}

class Scanner {
  private[this] val in = System.in
  private[this] val buffer = new Array[Byte](1024)
  private[this] var ptr = 0
  private[this] var buflen = 0

  private def hasNextByte: Boolean =
    if (ptr < buflen) true
    else {
      ptr = 0
      buflen = in.read(buffer)
      buflen > 0
    }

  private def readByte: Byte =
    if (hasNextByte) {
      ptr += 1
      buffer(ptr - 1)
    } else -1

  def hasNext: Boolean = {
    while (hasNextByte && !Scanner.isPrintableChar(buffer(ptr))) ptr += 1
    hasNextByte
  }

  def next: String = {
    if (!hasNext) throw new NoSuchElementException
    val sb = new java.lang.StringBuilder
    var b = readByte
    while (Scanner.isPrintableChar(b)) {
      sb.appendCodePoint(b)
      b = readByte
    }
    sb.toString
  }

  def nextLong: Long = {
    if (!hasNext) throw new NoSuchElementException
    var n = 0
    var minus = false
    var b = readByte
    if (b == '-') {
      minus = true
      b = readByte
    }
    if (b < '0' || '9' < b) throw new NumberFormatException

    @tailrec def loop(): Long = {
      if ('0' <= b && b <= '9') {
        n *= 10
        n += b - '0'
        b = readByte
        loop()
      } else if (b == -1 || !Scanner.isPrintableChar(b)) {
        if (minus) -n else n
      } else throw new NumberFormatException
    }

    loop()
  }

  def nextInt: Int = {
    val nl = nextLong
    if (nl < Integer.MIN_VALUE || nl > Integer.MAX_VALUE) throw new NumberFormatException
    nl.toInt
  }

  def nextDouble: Double = next.toDouble
}