import kotlin.math.*
import java.util.*

const val MOD = 1_000_000_007L

fun readI() = readLine()!!.toInt()
fun readL() = readLine()!!.toLong()
fun readD() = readLine()!!.toDouble()
fun readIs() = readLine()!!.split(' ').map(String::toInt)
fun readLs() = readLine()!!.split(' ').map(String::toLong)
fun readDs() = readLine()!!.split(' ').map(String::toDouble)

fun main() {
  val (n, m) = readIs()
  val g = mutableMapOf<Int, MutableList<Int>>()
  repeat(m) {
    val (a, b) = readIs()
    g.computeIfAbsent(a) { mutableListOf() }.add(b)
    g.computeIfAbsent(b) { mutableListOf() }.add(a)
  }
  val s = ArrayDeque<Int>()
  val c = BooleanArray(n + 1)
  var x = 0
  for (i in 1..n) {
    if (c[i]) continue
    s.push(i)
    var y = 0
    while (s.isNotEmpty()) {
      val j = s.pop()
      if (c[j]) continue
      c[j] = true
      y++
      val h = g[j] ?: continue
      for (e in h) {
        s.push(e)
      }
    }
    x = max(x, y)
  }
  println(x)
}
