n = gets.to_i p (0..n/5).map { |i| (0..i).select { |j| t = n - 5 * i - 2 * j; t >= 0 && t % 3 == 0 } } .flatten.size