The first and last terms of an AP are 1 and 11 respectively. If the sum of its terms is 36, find the number of terms.