#K69792. Candy Distribution Steps
Candy Distribution Steps
Candy Distribution Steps
John is preparing to distribute candies to n children. Each child has a specific candy requirement given by an array of integers. In a single step, John gives one candy to a child, and he repeats this process until all children have received the number of candies they desire.
Your task is to determine the total number of steps John needs to take to satisfy all children.
Mathematically, if the candy requirements are represented as \(a_1, a_2, \dots, a_n\), then the total number of steps is given by:
\[ S = \sum_{i=1}^{n} a_i \]inputFormat
The first line of input contains an integer n representing the number of children. The second line contains n space-separated integers, where the i-th integer denotes the number of candies desired by the i-th child.
outputFormat
Output a single integer representing the total number of steps needed to satisfy all the children.
## sample3
1 2 3
6