How to calculate same name as one? : I'm trying to calculate how many lines are there and my code is working but I failed to calculate if there is same name in each line as one for example

john 01/2

john 02/3


    def number_people(path):
    
        x = 0
        with open(path) as f:
            for line in f:
                if line.strip():
                    x += 1
        return x