Task: Program Execution
Input (English): A, H, Q, 6917, 7837
Output (English): 2