#C4294. Calculate Total Fine For Overdue Books

    ID: 47816 Type: Default 1000ms 256MiB

Calculate Total Fine For Overdue Books

Calculate Total Fine For Overdue Books

In this problem, you are given the number of books rented by a student and the number of days each book is returned late. The library charges a fine of \(5\) currency units for each day a book is overdue. Your task is to calculate the total fine accumulated by the student.

Mathematically, if the overdue days for each book are given as \(d_1, d_2, \dots, d_n\), then the total fine \(F\) is computed as:

\(F = 5 \times \sum_{i=1}^n d_i\)

Make sure your program reads the input from the standard input and writes the output to the standard output.

inputFormat

The input is provided via standard input and consists of two lines:

  • The first line contains an integer \(n\) representing the number of books.
  • The second line contains \(n\) space-separated integers where the \(i^{th}\) integer denotes the number of days the \(i^{th}\) book is returned late.

For example, the input "3\n2 0 4" indicates that there are 3 books with overdue days 2, 0, and 4, respectively.

outputFormat

Output a single integer which is the total fine incurred by the student. The fine for each overdue day is \(5\), so the total fine is calculated as \(5 \times (\text{sum of overdue days})\).

For example, if the input is "3\n2 0 4", the output should be "30" because \(5 \times (2 + 0 + 4) = 30\).

## sample
3
0 0 0
0