Using high-precision arithmetic, compute S=1!+2!+3!+…+n! where n≤50. Here, "!" denotes the factorial operation, for example: 5!=5×4×3×2×1. Given a positive integer n as input, output the computed result S.
A single positive integer n.
The computed result S.
5
153