Finding remaining months from given Ruby Array : I am building a tax calculation system in Ruby. In our country fiscal year starts from 4th month of the year. I need to calculate the number of remaining months from the given month. For example I have the array

    months = [4,5,6,7,8,9,10,11,12,1,2,3]
    
    Now If I give input 4 it should return 11, if 10 it should return 5. 

But the problem is that if 2 is given it should return 1 and even if 3 is given it should return 1 because if it returns 0 if 3 is given, the calculation has multiplication and whole expression becomes 0. So I need 1 when 2 and 3 is given.

How I solved for now is 

    @month == 3 ? annual_taxable_income += total_monthly_income_present_month : annual_taxable_income += total_monthly_income_present_month + @basic_salary * fiscal_months_array[@month-3, 12].size

The idea is I used ternary operator to check if there is 3 and if there is then do not find remaining months. The solution is working but I need a better way to do this so someone won't laugh looking at the code lol. Sorry if question is little dumb.
