Elliott went to the store for a bag of cookies. When he left the store he gave his mom half the cookies and half a cookie. He then came upon his aunt and gave her half the remaining cookies and half a cookie. Continuing on his way, he found his friend and gave him half the cookies left and half a cookie. When made it to class, he only had six cookies left. How many did he start out with?