package net.ipipip0129.yukicoder.no713; import java.util.ArrayList; import java.util.List; import java.util.Scanner; class Main { public static void main(String[] args) { Scanner scan = new Scanner(System.in); int num = Integer.parseInt(scan.nextLine()); if (num == 1) { System.out.println(0); return; } int sqrt_num = ((int)Math.sqrt(num)) + 1; List num_list = new ArrayList<>(); for (int i = 0; i < num; i++) { num_list.add(i + 1); } int pt = 1; //エラトステネスの篩 while (true) { int pt_num = num_list.get(pt); if (sqrt_num <= pt_num) { break; } for(int i = pt_num * 2; i <= num; i += pt_num) { if (num_list.indexOf(i) != -1) { num_list.remove(num_list.indexOf(i)); } } pt++; } int add_num = 0; for (int ans_num : num_list) { add_num += ans_num; } System.out.println(add_num - 1); } }