Justin, a deadline fighter as usual, forgot to pack enough shirts to UK! In particular, he only packed $S$ shirts to UK, labelled $1, 2, \cdots, S$. The house matron will help him do his laundry once a week, which he will need to put his shirts at the end of Tuesday, then he will get back his shirts at the end of Thursday. Justin doesn't want to wear dirty shirts or go outdoors naked, meaning he wears exactly one shirt per day. Let $D_i$ be the maximum number of times that shirt $i$ is worn between two laundaries. Find the minimum value of $\max(D_1, D_2, \cdots, D_S)$, if Justin wears clothes optimally.

Note that he will stay in the UK for a long time, so he would do a practically infinite number of laundries, once per week.

For example, let $S = 3$. The following image describes how Justin wear his 3 shirts (red, blue and green), and the scribbles on Tuesdays and Thursdays are the shirts that Justin put in / get back from the laundry.

If Justin follows this strategy of wearing shirts, the maximum days that Justin worn a shirt before washing is 4 days. Hence $\max(D_1, D_2, D_3) = 4$.
We can show that Justin cannot wear the shirts 3 days before washing, or else he will go naked in some day.
For instance, he wears red on Tuesday-Thursday, blue on Friday-Sunday, green to Monday to Wednesday, then he cannot wear anything on Thursday if $\max(D_i)=3$.

Input

The input consists of one integer, $S$.

Output

Output the minimum value of $\max(D_1, D_2, \cdots, D_S)$.

Constraints

$2 \le S \le 10^9$

Sample Test Cases

Input Output
3 4
1000000000 1
Click to copy.

Scoring: Per Subtask
Authored by s17f18
Appeared in 2022 Wah Yan Interschool Olympiad in Informatics 🤯🥷⚡🧠🏆