Memory limit: 256 MiB Time limit: 50 ms Input file: stdin Output file: stdout
Problem type: traditional Judging mode: text compare

Description

Alice loves eating fruits.
Bob loves eating fruits.
Charlie loves eating fruits.
David loves eating fruits.
Ema loves eating fruits.
Franky loves eating fruits.
George loves eating fruits.
......
Xenia loves eating fruits.
Yeti loves eating fruits.
Zara loves eating fruits.

Everyone loves eating fruits.

"Enough!" Bob shouted angrily. Then he saw a string containing a lot of subsequences of different kinds of fruits. "Fruits fruits fruits! Why are you everywhere! I never want to see you again."

Alice held an apple in front of Bob, and Bob raged. He punishing her by asking her to count the number of different kinds of fruit that appeared as a subsequence in a long long long string.

But Alice didn't know what fruits are.

Bob said, "apple, banana, orange, mango, grape, kiwi, peach, lemon, lime, pear, plum, fig, date, guava, papaya, cherry, melon, berry, apricot, avocado, blackberry, blueberry, boysenberry, cranberry, elderberry, gooseberry, raspberry, strawberry, acai, ackee, aronia, breadfruit, cantaloupe, carambola, clementine, coconut, currant, dragonfruit, durian, feijoa, grapefruit, hackberry, honeydew, jackfruit, jambul, jujube, kumquat, loquat, lychee, mandarin, mulberry, nectarine, olive, passionfruit, persimmon, pineapple, plantain, pomegranate, pomelo, prune, quince, rambutan, salak, sapodilla, soursop, tamarind, tangerine, ugli, watermelon, yuzu, abiu, acerola, ambarella, babaco, bael, barbados, bilberry, biriba, blood, calamansi, camu, canistel, capulin, carissa, ceriman, chayote, cherimoya, citron, damson, dewberry, eggfruit, emblica, genip, genipa, guanabana, hog, icecream, imbe, jaboticaba, june, kabosu, kapok, kepel, key, korlan, langsat, lanzones, longan, lucuma, macadamia, mamey, mangosteen, marang, maypop, medlar, melon, miracle, monstera, morinda, muscadine, muskmelon, nance, nungu, oil, otaheite, pawpaw, pecan, pepino, phalsa, pitanga, pitaya, pitomba, pulasan, purple, quandong, raisin, red, rose, safou, santol, sapote, saw, service, soncoya, sorb, surinam, sweetsop, syzygium, tamarillo, thimble, tomatillo, ugni, velvet, wampee, white, wolfberry, yangmei, yellow, youngberry, zapote, zigzag, zucchini are fruits."

Alice went dizzy...... Please help her to calculate.

Note I: melon != melon, so melon and melon are distinct fruits. ($i.e.$ please count melon twice)

Note II: 50 ms time limit -> $O(|T|\times|S|)$ solution cannot pass. (use getline(cin,s) for inputing the string)

Input

The input contains a string $S$, which contains lowercase alphabets only.

Output

Output the number of number of different kinds of fruit that appeared as a subsequence in string $S$.

Sample

Sample input

banapplenorange

Sample output

3

Sample explaination

The string contains "banana", "apple" and "orange" as subsequences. 

Constraint and hint

For all test data,
$1 \le |S| \le 10^6$

Subtask Score Additional Constraints
$1$ $30$ $1 \le |S| \le 1000$
$2$ $70$ No additional constraints

Scoring: Per Subtask
Authored by wy24215
Appeared in WYHK 2025 Mini Contest 4 [Pre-HKSC Heat]