Task: Program Execution
Input (English): B 8959 A c 2249 W K 4757 i M 7911 F 395 3465 2789 1129 7113 8177 T H 7111 5487 R K 6851 C 875 i 7931 q q T M 7441 i h
Output (English): 20