import java.util.*; import java.io.*; import static java.util.Arrays.*; import static java.lang.Math.*; public class No0110 { static final Scanner in = new Scanner(System.in); static final PrintWriter out = new PrintWriter(System.out,false); static void solve() { int nw = in.nextInt(); wb = new int[2][]; wb[0] = new int[nw]; for (int i=0; i count(1) ? count(0) : count(1)); } static int[][] wb; static int count(int f) { int[] ptr = new int[2]; int res = 0, max = 0; while (true) { while (ptr[f%2] < wb[f%2].length && wb[f%2][ptr[f%2]] <= max) ptr[f%2]++; if (ptr[f%2] == wb[f%2].length) return res; res++; max = wb[f%2][ptr[f%2]]; f++; } } public static void main(String[] args) { long start = System.currentTimeMillis(); solve(); out.flush(); long end = System.currentTimeMillis(); //trace(end-start + "ms"); in.close(); out.close(); } static void trace(Object... o) { System.out.println(Arrays.deepToString(o));} }