
    A city bus starts its route with a certain number of passengers and follows a predictable exit pattern where exactly two passengers leave at each subsequent stop. To optimize bus scheduling, you need to calculate the total passenger-stops (sum of passengers present at each stop) until the bus becomes empty or reaches its final stop. Write a function that takes the initial passenger count and calculates this sum by adding the number of remaining passengers at each stop (initial passengers, initial - 2, initial - 4, and so on) until no passengers remain or the count becomes negative. This calculation will help transit authorities determine the total passenger load across the entire route and adjust bus frequencies accordingly.
    

    
def sum_series(n):
    """
    A city bus starts its route with a certain number of passengers and follows a predictable exit pattern where exactly two passengers leave at each subsequent stop. To optimize bus scheduling, you need to calculate the total passenger-stops (sum of passengers present at each stop) until the bus becomes empty or reaches its final stop. Write a function that takes the initial passenger count and calculates this sum by adding the number of remaining passengers at each stop (initial passengers, initial - 2, initial - 4, and so on) until no passengers remain or the count becomes negative. This calculation will help transit authorities determine the total passenger load across the entire route and adjust bus frequencies accordingly.
    

    """
def sum_series(n):
    """
    A city bus starts its route with a certain number of passengers and follows a predictable exit pattern where exactly two passengers leave at each subsequent stop. To optimize bus scheduling, you need to calculate the total passenger-stops (sum of passengers present at each stop) until the bus becomes empty or reaches its final stop. Write a function that takes the initial passenger count and calculates this sum by adding the number of remaining passengers at each stop (initial passengers, initial - 2, initial - 4, and so on) until no passengers remain or the count becomes negative. This calculation will help transit authorities determine the total passenger load across the entire route and adjust bus frequencies accordingly.
    

    """
    if n < 1:
        return 0
    else:
        return n + sum_series(n - 2)