Problem Statement  
This problem statement contains superscripts and/or subscripts. It may not display properly outside the applet.
Little Rudolph had an important sequence of positive integers. The sequence consisted of N positive integers a_{0}, a_{1}, .., a_{N1}.
Rudolph wrote the sequence onto the blackboard in the classroom. While Rudolph had gone out, little Arthur came into the classroom and saw the sequence. Arthur likes to play with numbers as much as he likes to give his friends puzzles. So he did the following:
 First, he wrote a '+' or a '' between each pair of consecutive numbers (possibly using different signs for different pairs of numbers).

Next, for each sign he computed the result of the corresponding operation and wrote it under the sign.
I.e., if he used the '+' sign between a_{i} and a_{i+1}, he would write the sum a_{i}+a_{i+1} under this '+' sign.
Similarly, if he used the '' sign between a_{i} and a_{i+1}, he would write the difference a_{i}a_{i+1}. In this way he obtained a new sequence of N1 numbers b_{0}, b_{1}, .., b_{N2}.
 Finally, he erased the original sequence. Now there was only the operator sequence o_{0}, o_{1}, .., o_{N2} and the resulting number sequence b_{0}, b_{2}, .., b_{N2} left on the blackboard.
For example, if the original sequence was {1, 2, 3, 4}, and Arthur wrote operators {+, , +}, then the content of the blackboard changed like this:
1 2 3 4 > 1 + 2  3 + 4 > 1 + 2  3 + 4 > +  +
3 1 7 3 1 7
When Rudolph returned, he was shocked as his important sequence had disappeared. Arthur quickly told him what operations he had performed and that Rudolph has to simply reconstruct the orginal sequence.
Unfortunately, little Arthur did not realize that it is not necessarily possible to determine the original sequence uniquely. For example, both original sequences {1, 2, 3, 4} and {2, 1, 2, 5} lead to the same sequence {3, 1, 7} when operator sequence is {+, , +}.
The only thing Rudolph remembers about his original sequence is that all the integers were positive. Rudolph now wants to count all sequences of positive integers that match the blackboard. You are given int[] B and String operators both containing N1 elements. The ith element of B is the number b_{i} and ith element of operators will be '+' or '', meaning that the ith operator is + or , respectively. Return the number of different positive integer sequences A that lead to sequence B when operators operators are used in the way described. If there are infinitely many such sequences, return 1. Note that there may be test cases where no valid sequence A exists. For such test cases the correct return value is 0.   Definition   Class:  ImportantSequence  Method:  getCount  Parameters:  int[], String  Returns:  int  Method signature:  int getCount(int[] B, String operators)  (be sure your method is public) 
    Notes    It is guaranteed that the correct answer will always fit into the 32bit signed integer type.    The integer 0 (zero) is not positive. It may not occur in Rudolph's original sequence.   Constraints    B will contain between 1 and 50 elements, inclusive.    operators will contain the same number of characters as the number of elements in B.    Each element of B will be between 1000000000 (10^{9}) and 1000000000 (10^{9}), inclusive.    Each character in operators will be either '+' or '' (quotes for clarity).   Examples  0)     Returns: 2  From the problem statement. 

 1)     Returns: 1  There are infinitely many pairs of positive integers that differ by one. 

 2)     Returns: 0  Note that all numbers a_{i} have to be positive integers. 

 3)     4)    {540, 2012, 540, 2012, 540, 2012, 540}  "+++" 
 Returns: 1471  

This problem statement is the exclusive and proprietary property of TopCoder, Inc. Any unauthorized use or reproduction of this information without the prior written consent of TopCoder, Inc. is strictly prohibited. (c)2010, TopCoder, Inc. All rights reserved.
