public static void main(String[] args) {
		final int antall = 40000000;
		
		boolean[] primtall = Euler.primeArray(antall);
		int[] phi = new int[antall];
		for (int i = 2; i < antall; i++) {
			phi[i] = fi(i);
			if (i % 1000000 == 0)
				System.out.println(i);
		}
		long sum = 0;
		for (int i = 2; i < antall; i++) {
			int lol = phi[i];
//			System.out.println(lol);
			for (int j = 0; j < 25-2; j++) {
				lol = phi[lol];
//				System.out.print(lol + " ");
				
				if (j == 25-3 && lol == 1 && primtall[i])
					sum+=i;
				
			}
			
			if (i % 1000000 == 0)
				System.out.println(i);
			
		}
		System.out.println(sum);
	}