public static void main(String[] args) {
		long start = System.nanoTime();
		int sum = 13;
		for (Integer i = 101; i <= 1000000; i += 2) {
			boolean isCircular = true;
			if (isPrime(i)) {
				String origNum = i.toString();
				String newNumStr = null;
				circularLoop: for (int j = 1; j < origNum.length(); j++) {
					newNumStr = origNum.substring(origNum.length()-j)
							+ origNum.substring(0, origNum.length()-j);
					if (!isPrime(Integer.parseInt(newNumStr))) {
						isCircular = false;
						break circularLoop;
					}
				}
			} else
				isCircular = false;
			if (isCircular) {
				sum += 1;
			}
		}
		System.out.println(sum);
		System.out.println("Done in " + (double) (System.nanoTime() - start)
				/ 1000000000 + " seconds.");

	}