func main(input1: String = readLine()!) {
    let integers = input1.split(separator: " ").map { Int($0)! }
    let m = integers[1]
    
    var groups = [Set<Int>]()
    loop: for _ in 1...m {
        let integers = readLine()!.split(separator: " ").map { Int($0)! }
        let a = integers[0]
        let b = integers[1]
        for (i, group) in groups.enumerated() where group.contains(a) || group.contains(b) {
            groups[i].insert(a)
            groups[i].insert(b)
            continue loop
        }
        groups.append([a, b])
    }
    print(groups.map { $0.count }.max()!)
}

main()