
import kotlin.math.max

fun main() {
    solve()
}

private fun solve() {

    val (N, M) = readInts()

    val unionFind = UnionFind(N+1)

    repeat(M) {
        val (A, B) = readInts()


        unionFind.union(A, B )
    }
    var ans = 0
    unionFind.size.forEach {
        ans = max(ans, it)
    }
    println(ans)

//    println("size arr "+unionFind.size.joinToString())
//    println("parent arr "+unionFind.parent.joinToString())
}


class UnionFind(private val n: Int) {
    val parent: IntArray = IntArray(n)
    val size = IntArray(n)

    init {
        parent.forEachIndexed { index, i ->
            parent[index] = index
            size[index] = 1
        }
    }

    fun find(element: Int): Int {
        if (parent[element] == element) {
            return element
        }
        parent[element] = find(parent[element])
        return parent[element]
    }

    fun union(a: Int, b: Int) {
        val rootA = find(a)
        val rootB = find(b)

//        println("rootA $rootA sizeA ${size[rootA]} rootB $rootB ${size[rootB]}")
        if (rootA == rootB) return

        if (size[rootA] >= size[rootB]) {
            size[rootA] += size[rootB]
            parent[rootB] = rootA
        } else {
            size[rootB] += size[rootA]
            parent[rootA] = rootB
        }

//        println("AFTER PROCESS rootA $rootA sizeA ${size[rootA]} rootB $rootB ${size[rootB]}")
    }
}

private fun readLn() = readLine()!! // string line
private fun readInt() = readLn().toInt() // single int
private fun readStrings() = readLn().split(" ") // list of strings
private fun readInts() = readStrings().map { it.toInt() } // list of ints