while s=gets
  i=s.chomp.to_i
  count=0

  1000.times{ |a|
    if a>i then
      break
    end
    1000.times{ |b|
      if a+b>i then
        break
      end
      1000.times{ |c|
        if a+b+c>i then
          break
        end
        1000.times{ |d|
          if a+b+c+d>i then
            break
          end
          if (a+b+c+d)==i then
              count+=1
          end
        }
      }
    }
  }
  p count
end

