You are going to repair an old fence. The fence consists of several consecutive boards, some of which are broken and some of which are fine. The boards are numbered from left to right in increasing order. To repair all the boards between i and j, inclusive, where j is greater than or equal to i, a woodworker charges sqrt(j-i+1), where sqrt is the square root function. Due to the woodworker's pricing scheme, it is often necessary to repair boards even if they are not broken in order to get the best price.
The status of fence is given by multiple strings, so you should concatenate them into one string before calculating the repair cost.
Broken boards are represented by 'X' characters and good boards are represented by '.' characters. Print the minimal cost required to repair all broken boards.