Tony spent 1/4 of his money on 8 notebooks and 40 files. The cost of 4 files was the same as the cost of a notebook. He bought more notebooks with 1/2 of his remaining money. How many notebooks did Tony buy altogether?