#K70327. Calculate Total Overtime Hours

    ID: 33284 Type: Default 1000ms 256MiB

Calculate Total Overtime Hours

Calculate Total Overtime Hours

In this problem, you are given the number of employees along with their daily working hours for a week. For each employee, if the total hours worked in the week exceed 40, the extra hours are considered overtime. The overtime for an employee is computed as (\text{overtime} = \text{total hours} - 40) when (\text{total hours} > 40), otherwise it is 0. Your task is to calculate the cumulative overtime hours for all employees. This problem requires reading input from standard input and printing the result to standard output.

inputFormat

The input is given via standard input. The first line contains an integer (n) representing the number of employees. Each of the next (n) lines contains 7 space-separated integers where each integer represents the number of hours worked in a day for that employee.

outputFormat

Output a single integer representing the total overtime hours of all employees. The result should be printed to standard output.## sample

3
8 9 7 8 8 4 5
10 10 10 10 10 0 0
6 7 8 8 7 6 6
27