The average cost of F1 car is 6,8 million. Bear in mind that it is the price of the most basic components. It doesn’t include hundreds of millions spent on development and research. It’s quite a pricey machine.
Source