Time limit
2s
Memory limit
256 MB
There are 25 students seated in a 5*5 square grid. Each student belongs to either group S or group Y.
Choose 7 students to form one group. The group must satisfy all of the following conditions.
Y may be included.S.Given the seating chart, compute the number of ways to choose such a group of 7 students.
Five lines are given, from the first row to the fifth row of the seating chart. Each line has five characters, each either S or Y, with no spaces.
Print the number of valid groups of 7 students.
The following diagram shows two possible selected shapes.
..... .....SYSYS SYSYS....Y .Y.......S .S........ .......... .....SYSYS SYSYS....Y .Y.......S .S........ .....