A. Kep.uz Arena
time limit per test
1 second
memory limit per test
512 megabytes
input
standard input
output
standard output

Uzbek platform kep.uz hosts competitions of various types. One of them is called "Arena".

Anvar took part in some number of battles, which are given by string $$$s$$$. Each element $$$s[i]$$$ can be either "$$$\rm{W}$$$", "$$$\rm{D}$$$", or "$$$\rm{L}$$$", denoting a Win, Draw, or Loss, respectively.

Anvar receives $$$2$$$ points for a win, $$$1$$$ point for a draw, and $$$0$$$ points for losing. However, if Anvar wins three times in a row, he gets an additional $$$1$$$ point starting from the third win. The bonus continues until Anvar draws or loses.

Anvar can ask the administrator of kep.uz to remove some records (possibly none, or all) of his battles, without changing the order of the rest. Find the maximum number of points Anvar can get.

Input

The only line contains a string $$$s$$$ – the records of Anvar's participation. ($$$1 \le |s| \le 2 \cdot 10^5$$$, $$$s[i] \in \{$$$"$$$\rm{W}$$$", "$$$\rm{D}$$$", "$$$\rm{L}$$$"$$$\}$$$)

Output

Print the maximum number of points Anvar can get.

Scoring

Let $$$f(x)$$$ be the count of character $$$x$$$ in string $$$s$$$.

GroupAdd. constraintsPoints
$$$0$$$examples$$$0$$$
$$$1$$$$$$|s| \le 20$$$$$$14$$$
$$$2$$$$$$f($$$"$$$\rm{W}$$$"$$$)$$$ $$$\le 2$$$$$$8$$$
$$$3$$$$$$f($$$"$$$\rm{D}$$$"$$$)$$$ $$$\le 18$$$$$$20$$$
$$$4$$$$$$|s| \le 200$$$$$$16$$$
$$$5$$$$$$|s| \le 2000$$$$$$18$$$
$$$6$$$$$$24$$$
Examples
Input
LWWWDWWDDLWWWWL
Output
25
Input
WWWWWW
Output
16
Note

In the first example, Anvar can ask to delete his first and fifth battles. Then $$$s$$$ becomes "$$$\rm{WWWWWDDLWWWWL}$$$" and Anvar gets $$$2+2+3+3+3+1+1+0+2+2+3+3+0=25$$$ points in total, which is the maximum possible.

In the second example, it is not necessary to remove any battles. Anvar gets $$$2+2+3+3+3+3=16$$$ points.