"""
   In this scanerio, we imagine that we can somehow pay more 1000 for the first
   initial few months.
   Then, Does that solution bring down the total downpayment finally paid by
   the user
"""
principal = 500000
payment = 2684.11
rate = 0.05
total_paid = 0

# Extra payment info
extra_payment = 1000
extra_payment_start_month = 1
extra_payment_end_month = 60
month = 0

while principal > 0:
    month += 1
    if month >= extra_payment_start_month and month <= extra_payment_end_month:
        total_payment = payment + extra_payment
    else:
        total_payment = payment
    interest = principal * ( rate / 12 )
    principal = principal + interest - total_payment
    total_paid += total_payment

print('Total paid:', total_paid)
