Time

11:04:44
11 Feb 2012
ACM-ICPC Thailand Southern Region Programming Contest 2011
Left: 3 hours 56 minutes
End: 11.02.2012 15:00
Leader: Informatimukas
Five for week 22
Left: 10 hours 56 minutes
End: 11.02.2012 22:00
Leader: NuM
Version for print

Certification

   Teacher of Math prepared N samples for pupils with arithmetical actions +, -, *, : for certification. Every sample has some quantity of arithmetical actions. For receive certification every pupil must solve K samples from list, but you must use that way where every sample with more number from list has more quantity of arithmetical actions.

   How many ways you can create from list, that every way have K sample.


Specifications

   Input

   First line of input file has two numbers: N is a quantity of samples, which prepared the teacher, and K is quantity of samples, which you must solve for pass an examination.

   Next we have N lines, which number is equal to number of problem and have one sample with arithmetical actions +, -, *, :.

   1K100, 1N100. The quantity of arithmetical actions in sample does not exceed 1000.

   Output

   One number is quantity of differences ways. Two different ways must be differ one problem even if. If you can create any ways, than output -1.


Problem information

Time Limit: 1 seconds
Memory Limit: 64 MB
Balls for the passed test: 10
Complexity: 53% 28/60

Example

Example input

5 3
3*5-7
4-2
8:4*2
4+4*4-4
18:2*4:3-7

Example output

5


← The level of palindrome Problems Superstitious Santa Claus →