Book Shelves

You are going to buy book shelves to put all your books in. You already know how many books you have and need to count the number of book shelves you need. The books have three sizes: a small book takes $1$ width units, a medium book takes $2$ width units and a big book takes $3$ width units. Each shelf can fit a certain number of width units.

Given the number of books you have of each kind, write a program to compute the number of shelves you need if you want to buy as few shelves as possible.

There will be at most $20$ books of each kind.


The first line contains three integers that, in order, describes the number of small books, the number of medium books and the number of big books.

The second line contains the integer $S$, the size of a single shelf. You will always need at least 2 shelves.


Print the minimum number of shelves (all of them with size $S$) that you need to fit all the books.


Your program will be tested on three test cases. If you pass two of them, you will get $50$ points. If you pass all three of them, you will get $100$ points.

Sample Input 1 Sample Output 1
20 0 0
Sample Input 2 Sample Output 2
0 0 10
Sample Input 3 Sample Output 3
8 7 5
Sample Input 4 Sample Output 4
1 4 13