How do you calculate the loan amount?