Task: Program Execution
Input (English): b, d, T, W, J, 3707, R, 4109, D
Output (English): 7