928_D. Autocompletion
Arcady is a copywriter. His today's task is to type up an already well-designed story using his favorite text editor.

Arcady types words, punctuation signs and spaces one after another. Each letter and each sign (including line feed) requires one keyboard click in order to be printed. Moreover, when Arcady has a non-empty prefix of some word on the screen, the editor proposes a possible autocompletion for this word, more precisely one of the already printed words such that its prefix matches the currently printed prefix if this word is unique. For example, if Arcady has already printed «codeforces», «coding» and «codeforces» once again, then there will be no autocompletion attempt for «cod», but if he proceeds with «code», the editor will propose «codeforces».

With a single click Arcady can follow the editor's proposal, i.e. to transform the current prefix to it. Note that no additional symbols are printed after the autocompletion (no spaces, line feeds, etc). What is the minimum number of keyboard clicks Arcady has to perform to print the entire text, if he is not allowed to move the cursor or erase the already printed symbols?

A word here is a contiguous sequence of latin letters bordered by spaces, punctuation signs and line/text beginnings/ends. Arcady uses only lowercase letters. For example, there are 20 words in «it's well-known that tic-tac-toe is a paper-and-pencil game for two players, x and o.».

Input

The only line contains Arcady's text, consisting only of lowercase latin letters, spaces, line feeds and the following punctuation signs: «.», «,», «?», «!», «'» and «-». The total amount of symbols doesn't exceed 3·105. It's guaranteed that all lines are non-empty.

Output

Print a single integer — the minimum number of clicks.

Examples

Input

snow affects sports such as skiing, snowboarding, and snowmachine travel.
snowboarding is a recreational activity and olympic and paralympic sport.


Output

141


Input

'co-co-co, codeforces?!'


Output

25


Input

thun-thun-thunder, thunder, thunder
thunder, thun-, thunder
thun-thun-thunder, thunder
thunder, feel the thunder
lightning then the thunder
thunder, feel the thunder
lightning then the thunder
thunder, thunder


Output

183

Note

In sample case one it's optimal to use autocompletion for the first instance of «snowboarding» after typing up «sn» and for the second instance of «snowboarding» after typing up «snowb». This will save 7 clicks.

In sample case two it doesn't matter whether to use autocompletion or not.
```python
# python3
# utf-8

class Trie:
    def __init__(self):
        self.letter___node = {}
        self.words_nr = 0

    def add_word(self, word):
        word = word + '$'
        curr_node = self
        for letter in word:
            if letter not in curr_node.letter___node:
                curr_node.letter___node[letter] = Trie()
            curr_node.words_nr += 1
            curr_node = curr_node.letter___node[letter]

    def check_word(self, word):
        word = word + '$'
        curr_node = self
        for letter in word:
            if letter not in curr_node.letter___node:
                return False
            curr_node = curr_node.letter___node[letter]
        return True

    def count_word(self, word):
        word = word + '$'
        curr_node = self
        curr_state = 0
        presses_saved = 0
        for letter in word:
            if letter not in curr_node.letter___node:
                if curr_state == 1:
                    # print(presses_saved)
                    if '$' in curr_node.letter___node:
                        return min(len(word) - 1,
                            len(word) - 1 - presses_saved + 1
                        )
                    else:
                        return len(word) - 1
                if curr_state == 0:
                    return len(word) - 1
            if curr_node.words_nr > 1:
                curr_node = curr_node.letter___node[letter]
            elif curr_node.words_nr == 1:
                # print(letter, presses_saved)
                if curr_state == 0:
                    curr_state = 1
                presses_saved += 1
                curr_node = curr_node.letter___node[letter]
            elif curr_node.words_nr == 0:
                if curr_state == 1:
                    return min(len(word) - 1,
                        len(word) - 1 - presses_saved + 1
                    )
                elif curr_state == 0:
                    return len(word) - 1
        if curr_node.words_nr == 0:
            presses_saved -= 1
            if curr_state == 1:
                return min(len(word) - 1,
                    len(word) - 1 - presses_saved + 1
                )
            elif curr_state == 0:
                return len(word) - 1




text = ''
while(1):
    try:
        line = input()
        if line == '':
            raise Exception('e')
        text += line + '\n'
    except:
        break
# print(text)
ans = 0
syms = ['\n', '.', ',', '?', '!', "'", '-']
for sym in syms:
    text = text.replace(sym, ' ')
ans += text.count(' ')
idx___word = text.split(' ')
root = Trie()
root.add_word('$')
root.add_word('$$')
for word in idx___word:
    if word == '':
        continue
    count = root.count_word(word)
    check = root.check_word(word)
    # print(word, check, count)
    ans += count
    if not check:
        root.add_word(word)

print(ans)

```