n = gets.to_i cnt = 0 for i in 0..20 do for j in 0..i do k = (n - i * 5 - j * 2).div(3) if (k >= 0) then tmp = i * 5 + j * 2 + k * 3 if (j > i) then next end if (tmp == n) then cnt += 1 next print i print " " print j print " " puts k end end end end p cnt