Toilet Seat Policies

No attempts yetTime limit1sMemory limit256 MB

Problem

One of the touchier disputes in an office is whether the toilet seat should be left up or down. The minutes employees spend putting the seat where they want it add up to hours every week, so at a large company the question reaches working time. Count how many seat adjustments a bathroom policy causes.

The usual assumption is that a man uses the toilet with the seat up and a woman uses it with the seat down. Here we split people only into those who prefer the seat up and those who prefer it down, regardless of gender.

Several policies are possible. Consider these three.

  1. When you leave, always leave the seat up.
  2. When you leave, always leave the seat down.
  3. When you leave, leave the seat the way you would like to find it, that is, in the position you prefer.

So a person may have to adjust the seat before using the toilet and, depending on the policy, may have to adjust it again before leaving. One adjustment is one move of the seat, up or down.

Given the preferences of the people in order, compute how many adjustments happen in total under each of the three policies.

Input

The first and only line contains a string made of the characters 'U' and 'D'. Its length is at least 2 and at most 1000.

Let nn be the length of the string. The first character is the initial position of the toilet seat, where 'U' means up and 'D' means down. The remaining n1n-1 characters give the preferred position of the n1n-1 people who use the toilet, in order.

Output

Print one number on each of three lines: the total number of seat adjustments under policy 1, then under policy 2, then under policy 3.