The first term of an arithmetic sequence is and the last term is . If the sum of terms is , how many terms are in the sequence?