import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.HashMap; public class Main { public static void main(String[] args) { BufferedReader stdReader =new BufferedReader(new InputStreamReader(System.in)); try { int N = Integer.parseInt(stdReader.readLine()); int[] c = new int[N+1]; for(int i=1;i hMap = new HashMap<>(); while(hereN) here -= c[here]; result++; } System.out.println(result); } catch (IOException e) { e.printStackTrace(); } } }