def get_seconds_left(period, time_string):
    """ get_seconds_left calculates the seconds
    remaining in the game

    @param period (int): Integer indicating which quarter
        the game is in
    @param time_string (str): String of the format
        MM:SS for the time remaining in the quarter

    Returns:

        - seconds_remaining (int): Number of seconds
        remaining in the game
    """

    time_in_quarter = 12 #normal quarter is 12 minutes long
    if period > 4:
        time_in_quarter=5 #if it's overtime, 5 mins long
    mins, seconds = time_string.split(':') #from a string like "11:20", we have 11 mins, 20 seconds
    extra_after_quarter = (4-period)*time_in_quarter*60 
    if period > 4:
        #if overtime, we go into negatives, so 10 seconds into overtime is -10 and so on
        extra_after_quarter = (5-period)*time_in_quarter*60 
        time_elapsed = (time_in_quarter*60) - ((int(mins)*60)+(int(seconds))) # convert to seconds
        seconds_remaining = extra_after_quarter-time_elapsed
    else:
        seconds_remaining = extra_after_quarter+(int(mins)*60)+(int(seconds)) #convert to seconds

    return seconds_remaining