Task: Mathematics
Input (English): 298 @ 1699 @ 1367 @ 5001
Output (English): 8365