readlines.map(&:to_i).each{|n|
  cnt = 0
  1001.times{|a|
    break if n - a < 0
    next if n - a > 3000
    a.upto(1001){|b|
      break if n - a - b < 0
      next if n - a - b > 2000
      abflag = (a == b ? true : false)
      cd = n - a - b
      next if cd > 2000
      break if cd / 2 < b
      cdflag = (cd - cd/2 == cd / 2 ? true : false)
      bcflag = (b == cd / 2 ? true : false)
      if abflag
        if cdflag
          if bcflag
            cnt += 1
          else
            cnt += 4+12*(cd/2-b) - 6
          end
        else
          cnt += 4+12*(cd/2 - b)
        end
      else
        if cdflag && bcflag
          cnt += 4+24*(cd/2 - b)
        elsif cdflag
          cnt += 12+24*(cd/2 - b) - 12
        else
          cnt += 12+24*(cd/2 - b)
        end
      end
    }
  }
  puts cnt
}