object Main extends App {
  val sc = new java.util.Scanner(System.in)
  val n, m = sc.nextInt()
  val uft = new UnionFindTree(n)

  for (_ <- 1 to m) {
    val a, b = sc.nextInt() - 1
    uft.unite(a, b)
  }

  val ans = (0 until n).map(uft.size).max
  println(ans)
}

class UnionFindTree(n: Int) {
  private val par = Array.tabulate(n)(identity)
  private val rank = Array.fill(n)(1)
  private val size0 = Array.fill(n)(1)

  def root(x: Int): Int = {
    var res = x
    var children = List[Int]()
    while (par(res) != res) {
      children ::= res
      res = par(res)
    }

    for (y <- children) {
      par(y) = res
    }
    res
  }

  def unite(x: Int, y: Int): Unit = {
    val xr = root(x)
    val yr = root(y)
    if (xr != yr) {
      if (rank(xr) < rank(yr)) {
        par(xr) = yr
        size0(yr) += size0(xr)
      } else {
        par(yr) = xr
        size0(xr) += size0(yr)
        if (rank(xr) == rank(yr)) {
          rank(xr) += 1
        }
      }
    }
  }

  def size(x: Int): Int = size0(root(x))
}
