//Lisa Soros
//22 July 2008
//History Hack problem solution

import java.util.*;
import java.io.*;

public class history
{
	public static void main(String[] args) throws IOException
	{
		Scanner inFile = new Scanner(new File("history.in"));
		int numWords = inFile.nextInt();
		String word = null;
		int wordCount=0;
			
		// Read through each word.
		for(int x=0; x<numWords; x++)
		{
			word = inFile.next();
			word = word.toLowerCase();
			boolean corrupt = false;
			
			// Check if this word is corrupt.
			for(int y=0; y<word.length(); y++)
			{
				if(word.charAt(y)=='3')
				{
					corrupt = true;
				}
				else if(word.charAt(y)=='7')
				{
					corrupt = true;
				}
			}
			
			// Fix the word, no matter what.
			word = word.replace('3','e');
			word = word.replace('7','t');
			System.out.print(word+ " ");
			
			// Count it, if it was corrupted.
			if (corrupt)
				wordCount++;
		}
		
		// Print out the number of corrupt words.
		System.out.println("\nThere were "+ wordCount+ " corrupted words.");
		inFile.close();
	}
}