Given a string s, find the number of subsequence in s which forms the word "NSUPS". A subsequence is a sequence that can be derived from the string s by deleting some characters from it without changing the order of the remaining characters. You have to find the number of subsequences exists in the string s which is equal to "NSUPS".
For example, let's say s = "NNSUUPS". There are total four ways to select a subsequence equal to "NSUPS" from the string s. Those subsequences are "N_SU_PS", "N_S_UPS", "_NSU_PS" and "_NS_UPS".
The first line contains an integer N (1 ≤ N ≤ 1000) which denotes the length of the string s. The second line contains the string s consisting of uppercase English alphabets.
Print the answer in a single line.
Login to submit