// Arup Guha
// 5/9/2015
// Alternate Solution to UCF HS Contest Problem: Dinner Games
// Uses memoization.

import java.util.*;
import java.io.*;

public class dinnermemo {

	final public static int MAX = 100;
	final public static int[] DENOM = {2,5,10};
    public static long[] memo;

	public static void main(String[] args) throws Exception {

		Scanner fin = new Scanner(new File("dinner.in"));

		// Will store all answers here. ans[i] stores # ways to pay i dollars.
		memo = new long[MAX+1];
        Arrays.fill(memo, -1);

		// Process all cases.
		int numCases = fin.nextInt();
		for (int loop=1; loop<=numCases; loop++) {
			System.out.println("Dinner #"+loop+": "+solve(fin.nextInt()));
        }
		fin.close();
	}

	public static long solve(int n) {

        // Base cases.
        if (n == 0) return 1;
        if (n == 1) return 0;
        if (memo[n] != -1) return memo[n];

        // Add up three cases, of 2, 5 and 10 dollar bill being paid first.
        long res = 0;
        for (int i=0; i<DENOM.length; i++)
            if (n-DENOM[i] >= 0)
                res += solve(n-DENOM[i]);

        // Store and return.
        memo[n] = res;
        return res;
	}
}
