public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		
		long begin = System.currentTimeMillis();
		
		int[] sushu = new int[n + 1];
		for (int i = 0; i < sushu.length; i++) {
			sushu[i] = i;
		}
		sushu[1] = 0;
		for (int i = 2; i < sushu.length; i++) {
			for (int j = 2; i * j < sushu.length; j++) {
				sushu[i * j] = 0;
			}
		}

		ArrayList<Integer> list = new ArrayList<Integer>(10000);
		for (int i = 0; i < sushu.length; i++) {
			if (sushu[i] != 0) {
				list.add(sushu[i]);
			}
		}

		int[][] fenjie = new int[n + 1][19];
		sushu[0] = 1;
		sushu[1] = 1;
		for (int i = 1; i < sushu.length; i++) {
			//fenjie[i][0] = i;
			int temp = i;
			int index = 0;
			while (sushu[temp] == 0) {
				for (int j : list) {
					if (temp % j == 0) {
						temp = temp / j;
						fenjie[i][index++] = j;
						break;
					}
				}
			}
			fenjie[i][index] = temp;
		}

		long end = System.currentTimeMillis();

		System.out.println(end - begin);
	}