Problem: If an integer a is divisible by another integer b, then b is called the divisor of a.

For example: 12 has positive 6 divisors. They are 1, 2, 3, 4, 6 and 12.

Let’s define a function D(n) — number of integers between 1 and n (inclusive) which has exactly four positive divisors.

Between 1 and 10 only the integers 6, 8 and 10 has exactly four positive divisors. So, D(10) = 3.

You are given an integer n. You have to calculate D(n).

Input

The only line contains integer n (1 ≤ n ≤ 1011) — the parameter from the problem statement.

Output

Print the only integer c — the number of integers between 1 and n with exactly four divisors.

Examples

Input

10


Output

3


Input

20


Output

5

Solution (in JAVA):

Solution:
//package round12;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
import java.util.InputMismatchException;
import java.util.List;

public class F {
	InputStream is;
	PrintWriter out;
	String INPUT = "";
	int[] primes = sieveEratosthenes(400000);
	
	void solve()
	{
		long n = nl();
		long ans = 0;
		for(int i = 0;i < primes.length;i++) {
			long plus = countWithCache(n/primes[i], primes) - (i+1);
			if(plus <= 0)break;
			ans += plus;
		}
		
		for(int p : primes) {
			if((long)p*p*p <= n) {
				ans++;
			}else {
				break;
			}
		}
		out.println(ans);
	}
	
	public static long countWithCache(long x, int[] primes)
	{
		if(x < primes[primes.length-1]) {
			int ind = Arrays.binarySearch(primes, (int)x);
			return ind < 0 ? -ind-1 : ind+1;
		}else {
			return count(x);
		}
	}
	
	public static long count(long x)
	{
		int c = (int)Math.pow(x, 2./3);
		int[] primes = sieveEratosthenes(c);
		return count(x, primes);
	}
	
	// primes = Sieve.sieveEratosthenes(x^(2/3))
	public static long count(long x, int[] primes)
	{
		int ind = Arrays.binarySearch(primes, (int)Math.cbrt(x));
		if(ind < 0)ind = -ind-2;
		int a = ind+1;
		return a - p2xa(x, primes) + phi(x, a, primes) - 1;
	}
	
	private static long phi(long x, int a, int[] primes)
	{
		return S1(x) + S2(x, a, primes);
	}
	
	private static long S1(long x)
	{
		int c = (int)Math.cbrt(x);
		int[] lpf = enumLowestPrimeFactors(c);
		int[] mobius = enumMobiusByLPF(c, lpf);
		long ret = 0;
		for(int i = 1;i <= c;i++){
			ret += mobius[i] * (x/i);
		}
		return ret;
	}
	
	static long exret = 0;
	
	private static long S2(long x, int a, int[] primes)
	{
		final int C = (int)Math.cbrt(x);
		final int N = (int)Math.cbrt(x)*3/2;
		List<Pair> pairs = new ArrayList<>();
		exret = 0;
		dfs(a-1, 1, 1L, C, x, primes, pairs);
		Collections.sort(pairs, new Comparator<Pair>(){
			public int compare(Pair x, Pair y){
				if(x.xdn / N != y.xdn / N)return Long.compare(x.xdn, y.xdn);
				return x.b - y.b;
			}
		});

		// sieveBySegment
		final int NUM_MASK_PRIMES = 15;
		long[] mask = new long[NUM_MASK_PRIMES];
		for(int i = 0;i < NUM_MASK_PRIMES && i < primes.length;i++){
			for(int k = 0;k < 64;k += primes[i]){
				mask[i] |= 1L<<k;
			}
		}
		
		long[] phis = new long[a];
		int p = 0;
		long ret = 0;
		int m = (N>>>6)+1;
		long[] stand = new long[m];
		ret += exret;
		
		out:
		for(long k = 0;;k++){
			Arrays.fill(stand, -1L);
			stand[N>>>6] = (N&63) > 0 ? stand[N>>>6]<<-N>>>-N : 0; // erasing [N,
			int numstand = N;
			if(k == 0){ // not include 0
				numstand--;
				stand[0] ^= 1L<<0;
			}
			for(int b = 0;b < a;b++){
				while(p < pairs.size() && pairs.get(p).xdn < (k+1)*N && pairs.get(p).b == b){
//					U.tr("hit", p, phis[b], k, pairs.get(p).xdn - (long)k*N, (phis[b] + FenwickTree.sumFenwick(ft, (int)(pairs.get(p).xdn - (long)k*N))));
					int to = (int)(pairs.get(p).xdn - k*N);
					int lret = 0;
					for(int i = 0, j = 0;i <= to;i += 64, j++){ // [0,to]
						if(i+63 <= to){
							lret += Long.bitCount(stand[j]);
						}else{
							lret += Long.bitCount(stand[j]<<~to);
						}
					}
					ret += pairs.get(p).co * (phis[b] + lret);
//					U.tr(pairs.get(p), ret);
					p++;
				}
				if(p == pairs.size())break out;
				phis[b] += numstand;
				if(b < NUM_MASK_PRIMES){
					int r = primes[b];
					int delta = 64%r;
					for(int q = 0, o = (int)(r-1-(k*N+r-1)%r);q < m;q++, o -= delta){
						if(o < 0)o += r;
						numstand -= Long.bitCount(stand[q] & mask[b]<<o);
						stand[q] &= ~(mask[b]<<o);
					}
				}else{
					int r = primes[b];
					for(int q = (int)(r-1-(k*N+r-1)%r);q < N;q+=r){
						if(stand[q>>>6]<<~q<0){
							stand[q>>>6]^=1L<<q;
							numstand--;
						}
					}
				}
			}
//			U.tr(m, k, a);
		}
		
		return ret;
	}
	
	private static class Pair
	{
		int co;
		long xdn;
		int b;
		public Pair(int co, long xdn, int b) {
			this.co = co;
			this.xdn = xdn;
			this.b = b;
		}
		@Override
		public String toString() {
			return "Pair [co=" + co + ", xdn=" + xdn + ", b=" + b + "]";
		}
	}
	
	private static void dfs(int pos, int co, long mul, int c, long x, int[] primes, List<Pair> pairs)
	{
		for(int i = pos;i >= 0;i--){
			long nmul = mul * primes[i];
			if(nmul > c && c >= mul){
				// b+1 = i
				if(i == 0){
					exret += -co*(x/nmul);
				}else{
					pairs.add(new Pair(-co, x/nmul, i));
				}
			}else if(nmul <= c){
				dfs(i-1, -co, nmul, c, x, primes, pairs);
			}
		}
	}
	
	// TODO segmentSieveによりメモリO(x^(1/3))にする
	private static long p2xa(long x, int[] primes)
	{
		int a = (int)Math.cbrt(x);
		int b = (int)Math.sqrt(x);
		long ret = 0;
		
		int posa = Arrays.binarySearch(primes, a);
		if(posa < 0)posa = -posa - 2;
		ret += (long)posa*(posa+1)/2;
		
		int posb = Arrays.binarySearch(primes, b);
		if(posb < 0)posb = -posb - 2;
		ret -= (long)posb*(posb+1)/2;
		
		for(int i = posa+1;i <= posb;i++){
			int posp = Arrays.binarySearch(primes, (int)(x/primes[i]));
			if(posp < 0)posp = -posp - 2;
			ret += posp + 1;
		}
		return ret;
	}
	
	
	private static int[] enumLowestPrimeFactors(int n)
	{
		int tot = 0;
		int[] lpf = new int[n+1];
		int u = n+32;
		double lu = Math.log(u);
		int[] primes = new int[(int)(u/lu+u/lu/lu*1.5)];
		for(int i = 2;i <= n;i++)lpf[i] = i;
		for(int p = 2;p <= n;p++){
			if(lpf[p] == p)primes[tot++] = p;
			int tmp;
			for(int i = 0;i < tot && primes[i] <= lpf[p] && (tmp = primes[i]*p) <= n;i++){
				lpf[tmp] = primes[i];
			}
		}
		return lpf;
	}
	
	private static int[] enumMobiusByLPF(int n, int[] lpf)
	{
		int[] mob = new int[n+1];
		mob[1] = 1;
		for(int i = 2;i <= n;i++){
			int j = i/lpf[i];
			if(lpf[j] == lpf[i]){
//				mob[i] = 0;
			}else{
				mob[i] = -mob[j];
			}
		}
		return mob;
	}

	
	public static int[] sieveEratosthenes(int n) {
		if (n <= 32) {
			int[] primes = { 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31 };
			for (int i = 0; i < primes.length; i++) {
				if (n < primes[i]) {
					return Arrays.copyOf(primes, i);
				}
			}
			return primes;
		}

		int u = n + 32;
		double lu = Math.log(u);
		int[] ret = new int[(int) (u / lu + u / lu / lu * 1.5)];
		ret[0] = 2;
		int pos = 1;

		int[] isnp = new int[(n + 1) / 32 / 2 + 1];
		int sup = (n + 1) / 32 / 2 + 1;

		int[] tprimes = { 3, 5, 7, 11, 13, 17, 19, 23, 29, 31 };
		for (int tp : tprimes) {
			ret[pos++] = tp;
			int[] ptn = new int[tp];
			for (int i = (tp - 3) / 2; i < tp << 5; i += tp)
				ptn[i >> 5] |= 1 << (i & 31);
			for (int j = 0; j < sup; j += tp) {
				for (int i = 0; i < tp && i + j < sup; i++) {
					isnp[j + i] |= ptn[i];
				}
			}
		}

		// 3,5,7
		// 2x+3=n
		int[] magic = { 0, 1, 23, 2, 29, 24, 19, 3, 30, 27, 25, 11, 20, 8, 4, 13, 31, 22, 28, 18, 26, 10, 7, 12, 21, 17,
				9, 6, 16, 5, 15, 14 };
		int h = n / 2;
		for (int i = 0; i < sup; i++) {
			for (int j = ~isnp[i]; j != 0; j &= j - 1) {
				int pp = i << 5 | magic[(j & -j) * 0x076be629 >>> 27];
				int p = 2 * pp + 3;
				if (p > n)
					break;
				ret[pos++] = p;
				if ((long) p * p > n)
					continue;
				for (int q = (p * p - 3) / 2; q <= h; q += p)
					isnp[q >> 5] |= 1 << q;
			}
		}

		return Arrays.copyOf(ret, pos);
	}

	
	void run() throws Exception
	{
		is = oj ? System.in : new ByteArrayInputStream(INPUT.getBytes());
		out = new PrintWriter(System.out);
		
		long s = System.currentTimeMillis();
		solve();
		out.flush();
		tr(System.currentTimeMillis()-s+"ms");
	}
	
	public static void main(String[] args) throws Exception { new F().run(); }
	
	private byte[] inbuf = new byte[1024];
	public int lenbuf = 0, ptrbuf = 0;
	
	private int readByte()
	{
		if(lenbuf == -1)throw new InputMismatchException();
		if(ptrbuf >= lenbuf){
			ptrbuf = 0;
			try { lenbuf = is.read(inbuf); } catch (IOException e) { throw new InputMismatchException(); }
			if(lenbuf <= 0)return -1;
		}
		return inbuf[ptrbuf++];
	}
	
	private boolean isSpaceChar(int c) { return !(c >= 33 && c <= 126); }
	private int skip() { int b; while((b = readByte()) != -1 && isSpaceChar(b)); return b; }
	
	private double nd() { return Double.parseDouble(ns()); }
	private char nc() { return (char)skip(); }
	
	private String ns()
	{
		int b = skip();
		StringBuilder sb = new StringBuilder();
		while(!(isSpaceChar(b))){ // when nextLine, (isSpaceChar(b) && b != ' ')
			sb.appendCodePoint(b);
			b = readByte();
		}
		return sb.toString();
	}
	
	private char[] ns(int n)
	{
		char[] buf = new char[n];
		int b = skip(), p = 0;
		while(p < n && !(isSpaceChar(b))){
			buf[p++] = (char)b;
			b = readByte();
		}
		return n == p ? buf : Arrays.copyOf(buf, p);
	}
	
	private char[][] nm(int n, int m)
	{
		char[][] map = new char[n][];
		for(int i = 0;i < n;i++)map[i] = ns(m);
		return map;
	}
	
	private int[] na(int n)
	{
		int[] a = new int[n];
		for(int i = 0;i < n;i++)a[i] = ni();
		return a;
	}
	
	private int ni()
	{
		int num = 0, b;
		boolean minus = false;
		while((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-'));
		if(b == '-'){
			minus = true;
			b = readByte();
		}
		
		while(true){
			if(b >= '0' && b <= '9'){
				num = num * 10 + (b - '0');
			}else{
				return minus ? -num : num;
			}
			b = readByte();
		}
	}
	
	private long nl()
	{
		long num = 0;
		int b;
		boolean minus = false;
		while((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-'));
		if(b == '-'){
			minus = true;
			b = readByte();
		}
		
		while(true){
			if(b >= '0' && b <= '9'){
				num = num * 10 + (b - '0');
			}else{
				return minus ? -num : num;
			}
			b = readByte();
		}
	}
	
	private boolean oj = System.getProperty("ONLINE_JUDGE") != null;
	private void tr(Object... o) { if(!oj)System.out.println(Arrays.deepToString(o)); }
}