const input = require("fs").readFileSync("/dev/stdin", "utf8")
const lines = input.split('\n')
let [N, M] = lines[0].split(' ').map(Number)

const A = []
const B = []
for (let i = 0; i < M; i++) {
    const l = lines[i + 1].split(' ').map(Number)
    A[i] = l[0]
    B[i] = l[1]
}

const g = {}
for (let i = 0; i < M; i++) {
    const l = [A[i], B[i]]
    if (!g[A[i]] && !g[B[i]]) {
        g[A[i]] = l
        g[B[i]] = l
    } else if (g[A[i]] && g[B[i]]) {
        if (g[A[i]] !== g[B[i]]) {
            if (g[A[i]].length < g[B[i]].length) {
                g[A[i]].forEach(n => {
                    g[B[i]].push(n)
                    g[n] = g[B[i]]
                })
            } else {
                g[B[i]].forEach(n => {
                    g[A[i]].push(n)
                    g[n] = g[A[i]]
                })
            }
        }
    } else if (g[A[i]]) {
        if (!g[B[i]]) {
            g[B[i]] = g[A[i]]
        }
        g[B[i]].push(B[i])
    } else if (g[B[i]]) {
        if (!g[A[i]]) {
            g[A[i]] = g[B[i]]
        }
        g[A[i]].push(A[i])
    }
}

let ans = 0
Object.keys(g).forEach(key => {
    ans = Math.max(ans, g[key].length)
})
console.log(ans)
