public static void main(String[] args) {
		int petern = (int) Math.pow(4, 9);
		int peter[] = new int[37];
		for(int i = 0; i < petern; i++){
			peter[sum(pad(Integer.toString(i, 4), 9))]++;
		}

		int colinn = (int) Math.pow(6, 6);
		int colin[] = new int[37];
		for(int i = 0; i < colinn; i++){
			colin[sum(pad(Integer.toString(i, 6), 6))]++;
		}
		int sum = 0;
		for(int i = 0; i < 37; i++){
			sum += colin[i];
			colin[i] = sum;
		}
		
		double chance = 0.0;
		for(int i = 1; i < 37; i++){
			chance += 1.0 * peter[i] * colin[i-1] / petern / colinn;
		}
		System.out.println(chance);
	}