Saitomo, an A-Rank professional hero who is famous as the One-Punch-Man, decided to share the real secret of his power to one of his disciples.
Riana (Saitomo's disciple) became a hero because she couldn't find any other job. Despite this sad fact, she is able to learn Saitomo's secret and can now also defeat any enemy with one punch. She is so strong that the shockwaves of her punch can be transmitted through the bodies of her enemies. This means that if an enemy is punched and defeated, the shockwaves of Riana's punch travels through the enemy to the enemy's neighbors and their neighbors' neighbors and so on and so forth. This domino effect only stops if there is an empty space between two enemies.
One day, a number of enemies appeared around the city, and formed a *circle* to surround it.
Given a string where _X_ denotes that the space is occupied by an enemy, and _._ denotes that the space is empty, determine the minimum number of empty spaces that should be replaced with enemies so that Riana can defeat all enemies with _at most_ one punch. The string is circular, which means that the last character of the string circles back and is connected to the first character.
Note that _XXXXX_ means that the 5 enemies are beside each other, thus if you defeat any one of them, the shockwave will pass through and defeat all of them, but _.X.X._ will require Riana to use 2 punches to eliminate all enemies.
The only input contains a string, consisting of either _._ or _X_
The length of the string will not exceed 100 characters.
Output in a single line an integer denoting the minimum number of empty spaces needed to be filled with an enemy.
For the 2nd sample case, we can add 3 enemies (in locations 2, 3, 6) to connect all the enemies and transform it into _XXXXXXX..X_ which Riana can use to defeat them all in one punch.
## Input
The only input contains a string, consisting of either _._ or _X_The length of the string will not exceed 100 characters.
## Output
Output in a single line an integer denoting the minimum number of empty spaces needed to be filled with an enemy.
[samples]
## Note
For the 2nd sample case, we can add 3 enemies (in locations 2, 3, 6) to connect all the enemies and transform it into _XXXXXXX..X_ which Riana can use to defeat them all in one punch.
**Definitions**
Let $ n \in \mathbb{Z} $ be the number of dishes.
For each dish $ i \in \{1, \dots, n\} $:
- $ d_i \in \Sigma^* $: name of the dish ($ \Sigma = \{\text{lowercase letters}, \text{digits}, \_\} $)
- $ c_i \in \mathbb{Z}^+ $: number of friends wanting to taste dish $ i $
- $ z_i \in \mathbb{Z}^+ $: number of ingredients required for dish $ i $
For each ingredient $ j \in \{1, \dots, z_i\} $ in dish $ i $:
- $ s_{i,j} \in \Sigma^* $: name of ingredient
- $ a_{i,j} \in \mathbb{Z}^+ $: required quantity per portion
- $ u_{i,j} \in \{ \text{g}, \text{kg}, \text{mL}, \text{L}, \text{unit} \} $: unit of measurement
Let $ k \in \mathbb{Z}^+ $ be the number of price catalog entries.
For each $ i \in \{1, \dots, k\} $:
- $ t_i \in \Sigma^* $: ingredient name
- $ p_i \in \mathbb{R}^+ $: price per package
- $ a_i \in \mathbb{Z}^+ $: quantity per package
- $ u_i \in \{ \text{g}, \text{kg}, \text{mL}, \text{L}, \text{unit} \} $: unit of package
Let $ m \in \mathbb{Z}^+ $ be the number of nutrition catalog entries.
For each $ i \in \{1, \dots, m\} $:
- $ t_i \in \Sigma^* $: ingredient name
- $ a_i \in \mathbb{Z}^+ $: reference quantity
- $ u_i \in \{ \text{g}, \text{kg}, \text{mL}, \text{L} \} $: unit of reference quantity
- $ p_i \in \mathbb{R}^+ $: protein content (g) per reference quantity
- $ f_i \in \mathbb{R}^+ $: fat content (g) per reference quantity
- $ c_i \in \mathbb{R}^+ $: carbohydrate content (g) per reference quantity
- $ e_i \in \mathbb{R}^+ $: energy value (kcal) per reference quantity
**Constraints**
1. $ 1 \le n \le 1000 $
2. $ 1 \le c_i, z_i \le 100 $ for all $ i \in \{1, \dots, n\} $
3. $ 1 \le a_{i,j} \le 1000 $ for all $ i,j $
4. $ 1 \le k, m \le 1000 $
5. Units are convertible only within same type: mass (g ↔ kg), volume (mL ↔ L), or count (unit).
6. $ 1 \text{ kg} = 1000 \text{ g}, \quad 1 \text{ L} = 1000 \text{ mL} $
**Objective**
1. For each ingredient $ t $, compute total required quantity $ Q_t $ across all dishes and all portions:
$$
Q_t = \sum_{\substack{i=1 \\ s_{i,j}=t}}^{n} \sum_{j=1}^{z_i} c_i \cdot a_{i,j} \cdot \text{convert}(u_{i,j}, \text{base unit})
$$
where base unit is g for mass, mL for volume, unit for count.
2. For each ingredient $ t $ in price catalog, compute number of packages $ P_t $ to buy:
$$
P_t = \left\lceil \frac{Q_t}{a_i} \right\rceil \quad \text{(where } a_i \text{ is package size of } t \text{ in same unit)}
$$
3. Compute total cost:
$$
\text{Cost} = \sum_{t \in \text{price catalog}} P_t \cdot p_t
$$
4. For each dish $ i $, compute total nutritional content:
$$
\begin{aligned}
\text{Proteins}_i &= \sum_{j=1}^{z_i} c_i \cdot a_{i,j} \cdot \text{nutrient\_rate}(s_{i,j}, \text{protein}, u_{i,j}) \\
\text{Fats}_i &= \sum_{j=1}^{z_i} c_i \cdot a_{i,j} \cdot \text{nutrient\_rate}(s_{i,j}, \text{fat}, u_{i,j}) \\
\text{Carbs}_i &= \sum_{j=1}^{z_i} c_i \cdot a_{i,j} \cdot \text{nutrient\_rate}(s_{i,j}, \text{carb}, u_{i,j}) \\
\text{Energy}_i &= \sum_{j=1}^{z_i} c_i \cdot a_{i,j} \cdot \text{nutrient\_rate}(s_{i,j}, \text{energy}, u_{i,j})
\end{aligned}
$$
where $ \text{nutrient\_rate}(t, \text{nutrient}, u) = \frac{\text{nutrient value per } a_i \text{ in unit } u_i}{a_i} \cdot \text{convert}(u, u_i) $
**Output**
- Total cost (integer)
- For each ingredient in price catalog: $ t_i $ and $ P_{t_i} $
- For each dish $ i $: $ d_i $, $ \text{Proteins}_i $, $ \text{Fats}_i $, $ \text{Carbs}_i $, $ \text{Energy}_i $ (real numbers, error ≤ $ 10^{-3} $)