Problem list
Log in
#r03210 · Online Judge > GoldOJ

Three-Calendar Year

Silver V 2.0 s 1024 MB

Three calendars cycle every $15$, $28$ and $19$ years respectively; in year $1$ all read $1$, and each advances by $1$ per year, wrapping back to $1$ after its period. Given the current readings $S$, $M$, $V$, print which continental year it is (a unique answer is guaranteed).

Input

Three integers $S$, $M$, $V$ ($1 \le S \le 15$, $1 \le M \le 28$, $1 \le V \le 19$).

Output

Print the year number.

Example 1

Input
1 1 1
Output
1

Example 2

Input
1 16 16
Output
16

Example 3

Input
14 1 10
Output
29

Example 4

Input
1 2 3
Output
5266
Source
Online Judge > GoldOJ
Appears in
Not part of a ladder, contest or set yet.
Accepted 0 Submissions 0 Acceptance 0% Solvers 0

Discussion

Threads about this problem. Spoilers are collapsed; wrap hints in ||double bars||.

No discussion yet. Start a thread if something here needs explaining.

Recent submissions Open with filters
Code