405848: GYM102135 A BSUIR Open

Memory Limit:256 MB Time Limit:1 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

A. BSUIR Opentime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard output

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.

Input

You are given a single string s (1 ≤ |s| ≤ 1 000) — the original string, consisting only of digits and capital letters of the English alphabet.

Output

Print a single number — the number of ways to get the string "BSUIROPEN". Since the answer may be too large, print it modulo 109 + 7.

ExamplesInput
BSUIROPEN2018
Output
1
Input
BOSOQIVBONEOMOPTURSOCOS
Output
42

加入题单

算法标签: