405848: GYM102135 A BSUIR Open
Description
— And what if you make the task about BSUIR Open, where you need to find substring BSUIR Open?
— No, it's very simple.
— Indeed!
You are given a string s consisting only of digits and capital letters of the English alphabet. You can choose some characters from this string and make a new one from the chosen symbols. Determine how many ways you can get the string «BSUIROPEN» (without quotation marks). Two ways are considered different if there is such an index i that the i-th character of the string was selected in only one of the ways.
InputYou are given a single string s (1 ≤ |s| ≤ 1 000) — the original string, consisting only of digits and capital letters of the English alphabet.
OutputPrint a single number — the number of ways to get the string "BSUIROPEN". Since the answer may be too large, print it modulo 109 + 7.
ExamplesInputBSUIROPEN2018Output
1Input
BOSOQIVBONEOMOPTURSOCOSOutput
42