Bryan has quarters and nickels in his piggy bank. He has three times as many nickels as he has quarters. If the total value of the coins is $12, find the number of nickels in the piggy bank.