import Foundation

func readInt() -> Int {
    return Int(readLine()!)!
}

func readString() -> String {
    return readLine()!
}

func readLines(times: Int) -> [String] {
    var array = [String]()
    for _ in 0..<times {
        array.append(readLine()!)
    }
    return array
}

func readSeparatedStrings() -> [String] {
    return readLine()!.split(separator: " ").map({String($0)})
}

func readStringToStrings() -> [String] {
    return readLine()!.map({String($0)})
}

func readSeparatedInts() -> [Int] {
    return readLine()!.split(separator: " ").map({Int($0)!})
}
func readSeparatedDouble() -> [Double] {
    return readLine()!.split(separator: " ").map({Double($0)!/100000})
}

let n = readInt()

func triplets(n: Int) {
    var count = 0
    let l = n ^ (1/2)
    for i in 1...l {
        for j in 1...l {
            for k in 1...l {
                let total = (i * i) + (j * j) + (k * k) +  i * j + j * k + k * i
                if total == n {
                    count += 1
                }
            }
        }
    }
    print(count)
}

for _n in 1...n {
    triplets(n: _n)
}

