The American novelist Ernest Vincent Wright wrote the novel Gadsby without ever using the letter e.
Sanggeun's favorite novelist is Ernest too. These days he writes his own novel using only the first ten letters of the alphabet (a through j).
One day the e key on Sanggeun's keyboard broke. He has no money for a new keyboard, so he decides to delete every e already typed in his manuscript. His friend Seonyoung tells him that this is easy to do in Vim.
Sanggeun knows only three Vim commands: x, h, and f.
x deletes the character under the cursor. After the deletion the cursor keeps the same position (index), so it now points at the character that used to follow the deleted one. Therefore x cannot be used while the cursor is on the last character of the document.h moves the cursor one position to the left. If the cursor is already on the first character, it does not move.f must be followed by another character C. It moves the cursor to the nearest C that lies strictly to the right of the cursor. If there is no such C, the cursor stays where it is.Each x and each h counts as one keypress; an f command counts as two keypresses (the f plus the following character).
For example, suppose the text and the cursor are as below, where the character under the cursor is shown in brackets [ ]:
jeff[i]ehadabigidea
x gives jeff[e]hadabigidea.h gives jef[f]iehadabigidea.fi gives jeffiehadab[i]gidea.Given a document, write a program that computes the minimum number of keypresses needed to delete every e in it. No character other than e may be deleted. The cursor starts on the first character of the document. Because the e key is broken, the command fe cannot be used.
The first line contains the length N of the document. The second line contains the document itself. The document consists only of lowercase letters from a to j, and its first and last characters are not e. ($N \le 70000$)
Print, on the first line, the minimum number of keypresses needed to delete every e in the document.
For the first example document, pressing fdhxhhxffhxfahxhhhxhhhxfdhxfghxfahhx (36 keypresses) removes every e.
All of the commands described in this problem are real Vim commands.