public static void main(String[] args) throws IOException {
		long inicio = System.currentTimeMillis();
		StringBuilder out = new StringBuilder();
		BufferedReader in;
		File archivo = new File("entrada");
		if (archivo.exists())
			in = new BufferedReader(new FileReader(archivo));
		else
			in = new BufferedReader(new InputStreamReader(System.in));

		String line = "";
		int times = 0;
		while ((line = in.readLine()) != null) {
			if (line.equals("-1"))
				break;
			if (times++ > 0)
				out.append("\n");
			ArrayList<Integer> lista = new ArrayList<Integer>();
			lista.add(Integer.parseInt(line));

			while (!(line = in.readLine()).equals("-1")) {
				lista.add(Integer.parseInt(line));
			}

			arr = new int[lista.size()];
			dp = new int[arr.length];
			for (int i = 0; i < dp.length; i++) {
				dp[i] = -1;
			}
			for (int i = 0; i < arr.length; i++) {
				arr[i] = lista.get(i);
			}
			
			
			out.append("Test #" + times + ":\n"
					+ "  maximum possible interceptions: " + dfs(0) + "\n");
			System.out.println();
		}
		System.out.print(out);
		if (archivo.exists())
			System.out.println("Tiempo transcurrido : "
					+ (System.currentTimeMillis() - inicio) + " milisegundos.");
	}