p [*0..N=gets.to_i].repeated_permutation(3).count{|a,b,c|a>=b&&a*5+b*2+c*3==N}