{"trustable":false,"prependHtml":"\u003cstyle type\u003d\"text/css\"\u003e\n section pre {\n display: block;\n padding: 9.5px;\n margin: 0 0 10px;\n font-size: 13px;\n line-height: 1.42857143;\n word-break: break-all;\n word-wrap: break-word;\n color: #333;\n background: rgba(255, 255, 255, 0.5);\n border: 1px solid #ccc;\n border-radius: 6px;\n }\n\u003c/style\u003e\n\u003cscript\u003e\n window.katexOptions \u003d {\n delimiters: [\n {left: \u0027\\\\(\u0027, right: \u0027\\\\)\u0027, display: false},\n {left: \u0027\\\\[\u0027, right: \u0027\\\\]\u0027, display: true}\n ]\n };\n\u003c/script\u003e\n","sections":[{"title":"","value":{"format":"HTML","content":"\u003cdiv\u003eAs you remember from the previous tasks of challenge, our students like the math lessons, especially the number theory. Today a teacher decided to give a new problem for students to think. He wrote N positive integers and formula f(m) \u003d (m mod a[1]) + (m mod a[2]) + ...+ (m mod a[n]). Here, X mod Y denotes the remainder of the division of X by Y. Students need to find the maximum value of f.\n\u003ch3\u003eInput\u003c/h3\u003e\nThe first line of input includes integer N (2 \u0026lt;\u003d N \u0026lt;\u003d 3000). The following line has integers a[1], a[2], ..., a[N] (2 \u0026lt;\u003d a[i] \u0026lt;\u003d 10^5).\n\u003ch3\u003eOutput\u003c/h3\u003e\nPrint the maximum value of f\n\u003ch3\u003eExample\u003c/h3\u003e\n\u003cpre\u003e\u003cstrong\u003eInput:\u003c/strong\u003e \u003cbr /\u003e4\u003cbr /\u003e2 4 5 4\u003cbr /\u003e\n\u003cbr /\u003e\u003cstrong\u003eOutput:\u003c/strong\u003e \u003cbr /\u003e11\u003c/pre\u003e\n\u003c/div\u003e"}}]}