Target Practice

아직 제출이 없습니다시간 제한2초메모리 제한1024 MB

문제

Bessie is a robovine, also known as a cowborg. She is on a number line trying to shoot a series of $T$ $(1 \leq T \leq 10^5)$ targets located at distinct positions. Bessie starts at position $0$ and follows a string of $C$ $(1 \leq C \leq 10^5)$ commands, each one of L, F, or R:

  • L: Bessie moves one unit to the left.
  • R: Bessie moves one unit to the right.
  • F: Bessie fires. If there is a target at Bessie's current position, it is hit and destroyed, and cannot be hit again.

If you are allowed to change up to one command in the string to a different command before Bessie starts following it, what is the maximum number of targets that Bessie can hit?

입력

The first line contains $T$ and $C$.

The next line contains the locations of the $T$ targets, distinct integers in the range $[-C,C]$.

The next line contains the command string of length $C$, containing only the characters F, L, and R.

출력

Print the maximum number of targets that Bessie can hit after changing up to one command in the string.