Your grades on the various tests you take also count. Once the Navy has determined this magical number, you are ranked against all the other students who are selecting that week both from your squadron and every other primary training squadron. I think there's 5 or 6. You then put your choices in order of what aircraft you want to fly. The Navy students put down their top four choices and the Marine students their top three.
Marines choose from jets.
The needs of the Navy and Marine Corps will determine what aircraft slots are available that week. These numbers change from week to week and what I'm saying here is just an approximate average. Marine C-130 slots are pretty hard to come by from what I understand. Usually only about one slot a week. The Navy then looks at the number one person that week.