A teacher had t packs of notebooks, with 7 notebooks in each. He distributed 3 packs among his students. How many notebooks does he have left?