import java.util.*


fun main() {
  val (N, M) = readInts()
  val EN = Array(N) { hashSetOf<Int>() }
  repeat(M) {
    val (A, B) = readInts().map { it - 1 }
    EN[A].add(B)
    EN[B].add(A)
  }

  val memo = Array(N) { -1 }

  fun f(i: Int, n: Int): Int {
    var cnt = 0
    val stack = LinkedList<Int>()
    stack.add(i)
    while (stack.isNotEmpty()) {
      val p = stack.removeLast()
      if (memo[p] != -1) continue
      memo[p] = n
      cnt++
      EN[p].forEach {
        if (memo[it] == -1) stack.add(it)
      }
    }
    return cnt
  }

  println((0 until N).map { f(it, it) }.max())
}

fun readString() = readLine()!!
fun readStrings() = readString().split(" ")
fun readInt() = readString().toInt()
fun readLong() = readString().toLong()
fun readInts() = readStrings().map { it.toInt() }
fun readLongs() = readStrings().map { it.toLong() }
