Valentine's Day '19 J3 - Love!

View as PDF

Submit solution

Points: 7 (partial)
Time limit: 2.0s
Memory limit: 64M

Author:
Problem type
Heart-pounding confession from Hinata to Yui.

Part of the DMOJ Valentines '19 contest.

If I can meet you again, against the 6 billion to 1 odds, even if you can't move, I'll marry you.

- Hideki Hinata, Angel Beats

Ah, how nice it is to be young and in love! Indeed, Jonathan truly appreciates the love that has been spread around the world. Notably, he admires the word love.

Now, Jonathan is provided with a string S from Evan. Jonathan wants to know how many subsequences of love are contained within the string that was provided. The letters of love must be in order, but do not necessarily have to be consecutive.

Constraints

\left | S \right | \le 10^4, where \left | S \right | is the length of the string.

For 10% of the points, \left | S \right | \le 10.

For an additional 20% of the points, \left | S \right | \le 100.

Input Specification

The first line of input will contain a string S.

Output Specification

On a single line, output the number of subsequences love in S.

Sample Input 1

loveee

Sample Output 1

3

Sample Input 2

looxdvxdeee

Sample Output 2

6

Comments