import std.stdio, std.algorithm, std.conv, std.range, std.string;
 
void main(){
    string line;
    while(line = readln.chomp, line.length){
        auto d = line.to!int;
        int s;
        for(int x = 0; x < 600; x += d){
            s += x * x * d;
        }
        auto s2 = reduce!((a, b) => a + b * b * d)(0, iota(d, 599, d));
        if(s != s2) throw new Exception(text(d, " ", s, " ", s2));
        s.writeln;
    }
}