/* Problem 4--Triominoes
   Very easy if you break it up into cases.  There are C(n,3) ways to
   choose 3 numbers and reflections count each one of these twice.
   There are n(n-1) ways to get two numbers and n ways to have a three-
   of-a-kind. */

import java.io.*;
import java.util.*;

public class prob4 {

 public static Scanner in=null;
 public static PrintWriter out=null;
 public static int cs=1;

 public static void main (String[] args) throws Exception {

  in = new Scanner (new File ("prob4.in"));
  out = new PrintWriter ("prob4.out");
  int n = 0;
  while ((n=in.nextInt())> 0) {
   int ct = n*(n-1)*(n-2)/3 + n*(n-1) + n;
   out.println ("Case "+(cs++)+":  "+
                "There are "+ct+" triominoes numbered to "+n+".");
  }
  in.close();
  out.close();
 }
}
