var data = readLine()!.split(separator: " ")
let n = Int(data[0])!
let m = Int(data[1])!
var values = [Set<Int>]()
for _ in 0..<m {
    data = readLine()!.split(separator: " ")
    let a = Int(data[0])! - 1
    let b = Int(data[1])! - 1
    var id_a = -1, id_b = -1
    for s in values.enumerated() {
        if s.element.contains(a) {
            id_a = s.offset
        }
        if s.element.contains(b) {
            id_b = s.offset
        }
    }
    if id_a == id_b {
        if id_a == -1 {
            values.append(.init(arrayLiteral: a, b))
        } else {
            values[id_a].insert(a)
            values[id_a].insert(b)
        }
    } else {
        if id_a == -1 { values[id_b].insert(a) }
        else if id_b == -1 { values[id_a].insert(b) }
    }
}
print(values)
var result = 0
values.forEach { if result < $0.count { result = $0.count } }
print(result)