eolymp
bolt
Try our new interface for solving problems

Work

Watson is doing important work. He randomly chooses subsequence from the sequence \textbf{1}, \textbf{2}, …, \textbf{N} of length \textbf{M}. Rybka wants to join the work, but Watson refused to share selected numbers, he just agreed to say for each number whether it is prime or not. To start a work, Rybka needs to find out all the numbers from the subsequence. Your task is to calculate how many numbers from the subsequence Rybka is able to determine uniquely, based on the information provided. \InputFile The first line contains two integers \textbf{N} and \textbf{M}. The second line contains \textbf{M} letters -- description of the subsequence. Letter \textbf{Y} at \textbf{i}-th place means that \textbf{i}-th number is prime, \textbf{N the number is not prime}. \textbf{0} ≤ \textbf{N}, \textbf{M} < \textbf{3·10^4} (\textbf{M} ≤ \textbf{N}). \textbf{Ouput} You need to print one number -- count of subsequence elements that Rybka can determine. \textbf{Hint:} In the first sample, there are exactly 3 primes: 2, 3, 5 In the second sample, there are 3 integers which are not prime: 1, 4, 6 In the third sample, the first number can be either 2 or 3, the second number is 4, and the third should be 5 In the fourth sample, following options are available: 1, 4, 6; 4, 6, 8, etc. We cannot determine number at any position in the subsequence uniquely.
Time limit 1 second
Memory limit 16 MiB
Input example #1
5 3
YYY
Output example #1
3