We have created a formula to calculate the number of primes less than or equal to any given positive integer ‘n'. It is denoted by π (n). This is a fundamental concept in number theory and it is difficult to calculate. A prime number can be divided by 1 and itself . Therefore the set of primes (2,3,5,7,11,13,17.). The Prime Counting Function was conjectured the end of the 18th century by Gauss and by Legendre to be approximately x/Ln(x) But in this paper we are presenting the real formula, by applying the modern approach that is applying the basic concept of set theory.