409698: GYM103687 M BpbBppbpBB
Description
Grammy has learned how to engrave stamps recently. She engraved two types of special stamps, type C has a capital letter "B" on it, and type S has a small letter "b" or a small letter "p" on it. The shapes and sizes of the stamps are illustrated in the following picture.
Grammy stamped these letters (with rotations) on a grid paper without overlapping, the letters can only be pressed at the piece of paper if it lies totally inside the piece of paper. However, Grammy forgot how many times she used each type of stamps. Please count the letters and help her to remember them.
The black part of the stamps may be adjacent but may not overlap.
Note that the stamps can be rotated to a multiple of $$$90$$$ degrees.
InputThe first line consists of two integers $$$n,m$$$ ($$$1\leq n,m \leq 1\,000$$$), representing the size of the paper.
In the following $$$n$$$ lines, each line consists of $$$m$$$ characters, representing the current state of the paper. "#" stands for a black square and "." stands for a white square.
OutputOutput two integers, denoting the number of type C stamps and the number of type S stamps, respectively.
ExamplesInput10 17 ################# ################# ################# ####..#####..#### ###....###....### ###....###....### ####..#####..#### ################# ################# #################Output
1 0Input
14 11 .########## .########## .########## .####..#### .###....### .###....### .####..#### .########## .########## .########## .###....... .###....... .###....... .###.......Output
0 1Input
20 14 .##########... .##########... .##########... .####..####... .###....###... .###....###... .####..####... .##########... .##########... .##########... .############# .############# .############# .#######..#### ....###....### ....###....### ....####..#### ############## ############## ##############Output
0 2