public static void main(String args[]) throws Throwable {
		primes[0]=primes[1]=true;
		for(int i=0,c=0;i<MAX;i++)
			if(!primes[i]) {
				if(c<MAX_PRIMES)
					lstPrimes[c++]=i;
				for(int j=i+i;j<MAX;j+=i)
					primes[j]=true;
			}
		int MAX_SOL=10001;
		int[] euler=new int[MAX_SOL];
		for(int i=0;i<MAX_SOL;i++)
			euler[i]=(isPrime(i*i+i+41)?1:0)+(i>0?euler[i-1]:0);
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		for (String ln;(ln=in.readLine())!=null;) {
			StringTokenizer st=new StringTokenizer(ln);
			int A=parseInt(st.nextToken()),B=parseInt(st.nextToken());
			System.out.printf(Locale.US,"%.2f\n",100.*(euler[B]-(A>0?euler[A-1]:0))/(B-A+1));
		}
	}