Mario baked cookies for the class party.

The students ate
3
4
of what Mario brought.
The students on his bus ate
1
3
of what was left.
Mario had 6 when he got home.
How many cookies did Mario bake?