def get_total_seconds(time_str):
    """
    Return seconds from strings: "hh:mm:ss", "mm:ss" and "ss".

    """

    total_seconds = 0

    time_part = list(map(int, time_str.split(':')))
    time_part_number = len(time_part)

    if time_part_number == 1:
        total_seconds += time_part[0]

    elif time_part_number == 2:
        total_seconds += time_part[0] * 60 + time_part[1]

    elif time_part_number == 3:
        total_seconds += time_part[0] * 3600 + time_part[1] * 60 + time_part[2]

    return total_seconds