struct Friendship: Hashable {
    let a: Int
    let b: Int
    
    init(_ a: Int, _ b: Int) {
        if a < b {
            self.a = a
            self.b = b
        } else {
            self.a = b
            self.b = a
        }
    }
    
    func partner(of me: Int) -> Int {
        if me == self.a {
            return self.b
        } else {
            return self.a
        }
    }
}

func main(input1: String = readLine()!) {
    let integers = input1.split(separator: " ").map { Int($0)! }
    let m = integers[1]
    
    var friendships: Set<Friendship> = []
    for _ in 1...m {
        let integers = readLine()!.split(separator: " ").map { Int($0)! }
        let friendship = Friendship(integers[0], integers[1])
        friendships.insert(friendship)
    }
    
    func friends(of someone: Int) -> Set<Int> {
        var friendsOfSomeone = Set<Int>([someone])
        for friendship in friendships where friendship.a == someone || friendship.b == someone {
            let friend = friendship.partner(of: someone)
            friendsOfSomeone.insert(friend)
            friendships.remove(friendship)
            for friendOfFriend in friends(of: friend) {
                friendsOfSomeone.insert(friendOfFriend)
            }
        }
        return friendsOfSomeone
    }
    var friendGroups: [Set<Int>] = []
    var resolved = [Int]()
    for i in 1...m {
        guard !resolved.contains(i) else { continue }
        let friendsOfI = friends(of: i)
        resolved.append(contentsOf: friendsOfI)
        friendGroups.append(friendsOfI)
    }
    print(friendGroups.map { $0.count }.max()!)
}

main()