// Arup Guha
// 7/10/09
// Solution to BHCSI Homework Problem: String Class Practice, Part A

import java.util.*;

public class CountEs {
	
	public static void main(String[] args) {

		Scanner stdin = new Scanner(System.in);
		
		// Get the number of words.
		System.out.println("How many words are you going to enter?");
		int n = stdin.nextInt();
		
		System.out.println("Enter the words.");
		
		// Keep track of the most number of E's in a word and where they happened.
		int mostEs = 0;
		String best = "";
		
		// Loop through the words.
		for (int i=0; i<n; i++) {
			
			String tmp = stdin.next();
			
			// Count the number of E's in this word.
			int numEs = 0;
			for (int j=0; j<tmp.length(); j++)
				if (tmp.charAt(j) == 'e' || tmp.charAt(j) == 'E')
					numEs++;
			
			// Update if this is our best, or first word.		
			if (i == 0 || numEs > mostEs) {
				mostEs = numEs;
				best = tmp;
			}
		}		
			
		// Print out the string with the most number of Es.
		System.out.println("The word with the mostEs is "+best);
	}
}
