How is the answer for input 3 is 3?

Can you tell me how the output for sample test case is 3. I think 2/3 and 1/6 are the only possible magic factions. So the answer when n is 3 should be 3. Please explain.

@HemantKumar,
Now given a number N, you need to print the total number of magic fractions that exist, for all numbers from 1 till N (both inclusive).