
import java.util.*
fun findRoot(group : IntArray,  id : Int) : Int {
    var begin = id
    while(group[begin - 1] != begin){
        var temp = begin
        begin = group[begin - 1]
        group[temp - 1] = group[begin - 1]
    }
    return begin
}

fun main(args: Array<String>) {
    val reader = Scanner(System.`in`)

    val N = reader.nextInt()
    val M = reader.nextInt()

    val members = IntArray(N)
    for(index in 0..N-1) {
        members[index] = index + 1
    }

    val weights = IntArray(N)
    weights.fill(1)

    var maxGroupMembers = 0
    repeat(M){
        val a = reader.nextInt()
        val b = reader.nextInt()

        val rootA = findRoot(members, a)
        //println(rootA)
        val rootB = findRoot(members, b)
        //println(rootB)

        if(rootA != rootB) {
            if(weights[rootA - 1] + weights[rootB - 1] > maxGroupMembers){
                maxGroupMembers = weights[rootA - 1] + weights[rootB - 1]
            }

            if (weights[rootA - 1] <= weights[rootB - 1]) {
                weights[rootA - 1] += weights[rootB - 1]
                members[rootB - 1] = rootA
            }
            else {
                weights[rootB - 1] += weights[rootA - 1]
                members[rootA - 1] = rootB
            }
        }
    }

    println(if(M == 0) 1 else maxGroupMembers)
}