Tickets to a basketball game vary in price. Adult tickets cost $5 and student cost $1. A total of $2,874 was collected from selling 1,246 tickets. How many of each type of ticket were sold?