if n=1 then the formula answer is:0

if n=2 or n=3 or n=4 then the formula answer is:1

if n=5 or n=6 or.........or n=13 then the formula answer is:2

if n=14 or n=15 or.........or n=40 then the formula answer is:3

and so on.....

someone can help me to build the formula that makes thos calculations???