Universal Cup Judging System

Universal Cup

時間限制: 1.0 s 記憶體限制: 1024 MB 總分: 100
统计

Yesterday at 9:00, the mandatory activities related to the AMPPZ contest began. The schedule contained $n$ activities that followed one after another, lasting $t_1, t_2, \dots, t_n$ minutes respectively. Yesterday at 19:00, the famous hacking contest also took place, and by that time, the participants wanted to already be in the hotel.

Determine how much time the participants had to return to the hotel after the last activity, assuming everything went according to plan yesterday.

Input

The first line contains an integer $n$ ($1 \le n \le 100$), denoting the number of activities.

The second line contains a sequence of $n$ integers $t_1, t_2, \dots, t_n$ ($1 \le t_i \le 500$), denoting the durations of the consecutive activities in minutes.

You may assume that the organizers ensured that all activities in the schedule ended no later than yesterday at 18:59, leaving the participants a positive amount of time to return to the hotel.

Output

Print a single integer — the number of minutes the participants had left to return to the hotel.

Example

Input

10
45 15 180 60 30 15 105 15 30 45

Output

60

Note

The consecutive activities in the schedule were as follows:

Hours Activity
09:00–09:45 Opening
09:45–10:00 Break
10:00–13:00 Lecture session
13:00–14:00 Lunch
14:00–14:30 Contest organization rules
14:30–14:45 Break
14:45–16:30 Practice contest
16:30–16:45 Break
16:45–17:15 Practice contest discussion
17:15–18:00 Dinner

Exactly 60 minutes remained to return to the hotel before 19:00.

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.