fun main(args: Array<String>) {
    val (n, m) = getInts()
 
    val a = IntArray(n) { it }
    repeat(m) {
        val (x, y) = getInts().map { it - 1 }
        val p1 = parentOf(x, a)
        val p2 = parentOf(y, a)
        if (p1 < p2) {
            a[p2] = p1
        } else {
            a[p1] = p2
        }
    }
 
    val k = HashMap<Int, Int>()
    a.indices.forEach {
        val p = parentOf(it, a)
        k[p] = (k[p] ?: 0) + 1
    }
    println(k.map { it.value }.max())
}
 
fun parentOf(k: Int, a: IntArray) : Int {
    if (a[k] == k) return k
    else return parentOf(a[k], a).also {
        a[k] = it
    }
}
 
fun getInt() = readLine()!!.toInt()
fun getInts() = readLine()!!.split(" ").map { it.toInt() }
fun getLong() = readLine()!!.toLong()
fun getLongs() = readLine()!!.split(" ").map { it.toLong() }