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 the number itself. The set of all primes can be written as { 2,3,5,7,11,13,17,...............}. The Prime Counting Function was conjectured in the end of 18th century by the famous Mathematician Gauss and Legendre Sir, to be approximately x/(ln x) .But in this paper we are presenting the real formula, by applying the modern approach, that is by applying the basic concept of set theory.