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

fun main() {
    val (n, m) = readInts()

    val neighbors = Array<MutableSet<Int>>(n + 1) { mutableSetOf() }

    repeat(m) {
        val (a, b) = readInts()
        if (b !in neighbors[a]) {
            neighbors[a].add(b)
            neighbors[b].add(a)
        }
    }

    val seen = BooleanArray(n + 1)

    fun bfs(v: Int): Int {
        val queue = LinkedList<Int>()
        queue.add(v)
        seen[v] = true
        var size = 0
        while (queue.isNotEmpty()) {
            val curr = queue.removeFirst()
            size++
            for (u in neighbors[curr]) {
                if (!seen[u]) {
                    seen[u] = true
                    queue.add(u)
                }
            }
        }
        return size
    }

    var ans = 1

    for (i in 1..n) {
        if (neighbors[i].isNotEmpty() && !seen[i]) {
            ans = max(bfs(i), ans)
        }
    }

    println(ans)
}

// Input Reader
private fun readLn() = readLine()!!

private fun readStrings() = readLn().trim().split(" ")
private fun readInts() = readStrings().map { it.toInt() }
