public static void main(String[] args) {
		boolean[] isPrime = EulerMath.getSieve(N);
		int count = 0;
		
		for(int i = 2; i < isPrime.length; i++)
			if(isPrime[i]) {
				List<LinkedList<Integer>> perms = getCircularPerms( EulerMath.intToDigits(i) );
				boolean add = true;
				
				for(int j = 0; j < perms.size() && add; j++)
					if( !isPrime[ EulerMath.digitsToInt(perms.get(j)) ] )
						add = false;
				
				if(add)
					count++;
		}
		System.out.println("\n"+ count);	
	}