There are 4 different types of books in a pile and 17 total books in the pile, the number of type A books is 4, the number of type B books is equal to the number of type C books and the number of type D books is equal to the sum of type A and B books. How many type D books are there in the pile?