Returns the serial number of the last day of the month before or after a specified number of months