Apartment A requires a $300 security deposit and costs $750 each month. Apartment B has a $500 security deposit and the monthly rent is $725. Write and solve an equation to find the number of months it will take for the total rental costs to be the same.