import math


def determine_month(day):
    """
    returns 0-indexed month given a 0-indexed day
    """
    d = int(math.ceil(day)) % 365
    
    for i, m in enumerate([31, 59, 90, 120, 151, 181, 
                           212, 243, 273, 304, 334, 365]):
        if d < m:
            return i