/**
 * Created by IntelliJ IDEA.
 * User: Administrator
 * Date: 3/3/12
 * Time: 11:00 AM
 * To change this template use File | Settings | File Templates.
 */

import SRMLib.MathLibrary;
import SRMLib.TestSRMLib;
import com.sun.org.apache.bcel.internal.generic.F2D;

import java.io.*;
import java.util.*;
import java.util.zip.Inflater;

public class SRM {
    public static void main(String[] args) throws IOException {
        //TestSRMLib.run();
        codeJam1.main();

        return;
    }
}
class codeJam1 {
    public static void main() throws IOException {
        String inputPath = "E:\\input.txt";
        String outputPath = "E:\\output.txt";
        BufferedReader input = new BufferedReader(new FileReader(inputPath));
        BufferedWriter output = new BufferedWriter(new FileWriter(outputPath));

        String line;
        line = input.readLine();
        int T = Integer.parseInt(line);
        for (int i = 1; i <= T; ++i) {
            line = input.readLine();
            String[] words = line.split(" ");
            int N = Integer.parseInt(words[0]);
            int S = Integer.parseInt(words[1]);
            int p = Integer.parseInt(words[2]);
            int n = 0;
            int res = 0;

            for (int j = 3; j < words.length; ++j) {
                if (p == 0) {
                    res++;
                    continue;
                }

                int t = Integer.parseInt(words[j]);
                if (p == 1) {
                    if (t > 0)
                        res++;
                    continue;
                }
                if (t >= 3 * p - 2)
                    res++;
                else if (t >= 3 * p - 4)
                    n++;
            }

            res += Math.min(n, S);
            output.write("Case #" + i + ": " + res);
            output.newLine();
        }

        input.close();
        output.close();
    }
}

package codejam.suraj.quals2012.googlerese;

import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;

import codejam.suraj.quals2012.CodeJamSkeleton;

public class Googlerese extends CodeJamSkeleton {

	public static Map<Character, Character> map = 
			new HashMap<Character, Character>(52);
	
	public static void initializeCharMap(){
		map.put('e','o');
		map.put('j','u');
		map.put('p','r');
		map.put('m','l');
		map.put('y','a');
		map.put('s','n');
		map.put('l','g');
		map.put('j','u');
		map.put('y','a');
		map.put('l','g');
		map.put('c','e');
		map.put('k','i');
		map.put('d','s');
		map.put('k','i');
		map.put('x','m');
		map.put('v','p');
		map.put('e','o');
		map.put('d','s');
		map.put('d','s');
		map.put('k','i');
		map.put('n','b');
		map.put('m','l');
		map.put('c','e');
		map.put('r','t');
		map.put('e','o');
		map.put('j','u');
		map.put('s','n');
		map.put('i','d');
		map.put('c','e');
		map.put('p','r');
		map.put('d','s');
		map.put('r','t');
		map.put('y','a');
		map.put('s','n');
		map.put('i','d');
		map.put('r','t');
		map.put('b','h');
		map.put('c','e');
		map.put('p','r');
		map.put('c','e');
		map.put('y','a');
		map.put('p','r');
		map.put('c','e');
		map.put('r','t');
		map.put('t','w');
		map.put('c','e');
		map.put('s','n');
		map.put('r','t');
		map.put('a','y');
		map.put('d','s');
		map.put('k','i');
		map.put('h','x');
		map.put('w','f');
		map.put('y','a');
		map.put('f','c');
		map.put('r','t');
		map.put('e','o');
		map.put('p','r');
		map.put('k','i');
		map.put('y','a');
		map.put('m','l');
		map.put('v','p');
		map.put('e','o');
		map.put('d','s');
		map.put('d','s');
		map.put('k','i');
		map.put('n','b');
		map.put('k','i');
		map.put('m','l');
		map.put('k','i');
		map.put('r','t');
		map.put('k','i');
		map.put('c','e');
		map.put('d','s');
		map.put('d','s');
		map.put('e','o');
		map.put('k','i');
		map.put('r','t');
		map.put('k','i');
		map.put('d','s');
		map.put('e','o');
		map.put('o','k');
		map.put('y','a');
		map.put('a','y');
		map.put('k','i');
		map.put('w','f');
		map.put('a','y');
		map.put('e','o');
		map.put('j','u');
		map.put('t','w');
		map.put('y','a');
		map.put('s','n');
		map.put('r','t');
		map.put('r','t');
		map.put('e','o');
		map.put('u','j');
		map.put('j','u');
		map.put('d','s');
		map.put('r','t');
		map.put('l','g');
		map.put('k','i');
		map.put('g','v');
		map.put('c','e');
		map.put('j','u');
		map.put('v','p');
		map.put('z','q');
		map.put('q','z');
		map.put(' ',' ');
	}
	
	
	
	@Override
	protected void handleTestCase(int testCaseNumber) throws IOException {
		
		String line = readLine();
		StringBuffer text = new StringBuffer(line.length());
		for(int i = 0; i < line.length(); ++i)
		{
			text.append(map.get(line.charAt(i)));
		}
		System.out.println(text);
		addOutput(testCaseNumber, text.toString());
	}
	
	/**
	 * @param args
	 */
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		initializeCharMap();
		CodeJamSkeleton testCase = new Googlerese();
		testCase.handleAllTestCases(args[0], args[1]);
		
	}

}
