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