# Neural Network Training Report

*English translation by SOTA – AI Community of the Russian original. Organisers who would like this translation removed can email sota.ai.community@gmail.com.*

*Task 6 of the school stage (Moscow) of the All-Russian School Olympiad (VsOSh) 2025/26 in artificial intelligence, grades 9–11. Original: [tasks-ai-9-11-sch-msk-25-26.pdf](https://vos.olimpiada.ru/upload/files/Arhive_tasks/2025-26/school/ai/tasks-ai-9-11-sch-msk-25-26.pdf).*

**Neural network training report** · standard input · standard output · 1 second · 256 megabytes

*Translator's note: in the original, this line is printed run together, without labels. It gives the task title, then "standard input", "standard output", "1 second" and "256 megabytes", i.e. the input file, output file, time limit and memory limit.*

Neural network training is usually divided into epochs. During one epoch of training, the model passes through the training dataset once.

Dima worked on a new project for a long time. Its training took as many as $n$ epochs. After each epoch, Dima wrote down the current time in the format $HH:MM$ (for example, $13:03$). Now Dima wonders what the minimum amount of time spent on training the model could have been.

Dima is very busy with work tasks at the moment, so he has turned to you for help. Compute the minimum amount of time that could have been spent on training the model.

## Input format

The first line of the input contains one integer $n$ ($2 \le n \le 10^4$).

The next $n$ lines give the moments of time at which each successive epoch ended, in the format $HH:MM$ (24-hour format).

## Output format

Output one integer: the minimum number of minutes that could have been spent on training the model. Round the answer down to the nearest whole number of minutes.

## Note

In the first test example, exactly 10 full hours passed $(14 - 24)$. There were also 56 minutes from $13:03$ to $14:00$ (not 57, because $13:03$ could have been $13:03:59$). And another 15 minutes passed from $00:00$ to $00:15$. In total, $10 \cdot 60 + 56 + 15 = 671$.

*Translator's note: the paper does not print the test examples that this note refers to.*

*Translator's note: the statement paper gives only the total for the olympiad (112 points); the official solutions give this task a maximum of 20 points (1 point for each test not taken from the statement).*
