Unmanned aerial vehicles have been widely used in many areas of life. They communicate with each other or infrastructure to provide ubiquitous coverage or assist cellular and sensor networks. They construct flying ad hoc networks. One of the most significant problems in such networks is communication among them over a shared medium. Using random channel access techniques is a useful solution. Another important problem is that the variations in the density of these networks impact the quality of service and introduce many challenges. This paper presents a novel density-aware technique for flying ad hoc networks. We propose Density-aware Slotted ALOHA Protocol that utilizes slotted ALOHA with a dynamic random access probability determined using network density in a distributed fashion. Compared to the literature, this paper concentrates on proposing a three-dimensional, easily traceable model and stabilize the channel utilization performance of slotted ALOHA with an optimized channel access probability to its maximum theoretical level, 1/e, where e is the Euler's number. Monte-Carlo simulation results validate the proposed approach leveraging aggregate interference density estimator under the simple path-loss model. We compare our protocol with two existing protocols, which are Slotted ALOHA and Stabilized Slotted ALOHA. Comparison results show that the proposed protocol has 36.78% channel utilization performance; on the other hand, the other protocols have 24.74% and 30.32% channel utilization performances, respectively. Considering the stable results and accuracy, this model is practicable in highly dynamic networks even if the network is sparse or dense under higher mobility and reasonable non-uniform deployments.