class Calc0152 def initialize(args) args = args.map { |l| l.chomp.split(/\s+/) } @l = args.shift.first.to_i end def run (2..(Math.sqrt(@l / 4).floor)).flat_map { |m| (1...m).select { |n| (m - n).odd? && m.gcd(n) == 1 && 8 * m * (m + n) <= @l } }.size end end puts Calc0152.new(STDIN.readlines).run if __FILE__ == $0