def find_when_entered_basement(text):
    """Find position in text when santa enters basement first time."""
    cur_floor = 0
    for position, floor_change in enumerate(text, start=1):
        cur_floor += 1 if floor_change == '(' else -1
        if cur_floor < 0:
            return position
    return -1