Task: Program Execution
Input (English): 2487 n 5475 6849 7399 b r J 1371 b 3119 4449 r P D 5911 h b S 6287 1297 9809 m 1255 3227
Output (English): 12