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
Discussion
Threads about this problem. Spoilers are collapsed; wrap hints in
||double bars||.No discussion yet. Start a thread if something here needs explaining.