let _ =
  let rec range s t d f = if s > t then [] else (f s) :: range (s + d) t d f in
  let area d f = List.fold_left (+) 0 (range d (600 - d) d (fun x -> d * (f x))) in
  try
    while true do
      Scanf.scanf "%d\n" (fun d -> Printf.printf "%d\n" @@ area d (fun x -> x * x))
    done
  with
    End_of_file -> ()