Skip to main content
Tuesday (24.11.2026) at 20:00: ALGOR Contest: Round #4 (Special Challenge) starts!

~/algor $ cat problems/haftaning-kuni

Day of the week

Medium 1000 ms 64 MB 36%
Share

The first day of the year is a Monday. Find which day of the week the $k$-th day of the year is ($1$ — Monday, $2$ — Tuesday, …, $7$ — Sunday).

A circle of the weekdays with one day marked

Input

One positive integer $k$.

Output

One integer — the number of the weekday (from $1$ to $7$).

Note

$1 \le k \le 366$

Examples

Input #1
1
Output #1
1
Input #2
7
Output #2
7

Sign in to submit a solution

Signing up is free and takes a minute.