Task: Program Execution
Input (English): 6427, N, J, 4505, B, H
Output (English): 2