I went to a store with my friends. There were ten of them. I promised them to buy gifts for each one of them. For three girls, I bought them a _____ each which cost me 4 dollars each. For 7 boys, I bought ______ for each one of them which cost 5 dollars each. I much did I have to pay in total?