// P6.10

public class Midterm {
  public static int times = 100000; 
  public static void main(String[] args) {
    int times = Midterm.times, count = 0; 
    while (times > 0) { 
      // first experiment: four dice one six 
      boolean won = false; 
      for (int i = 0; i < 4; i++) {
        // throw dice
        int dice = Midterm.roll(); 
        // System.out.print( dice + " "); 
        if (dice == 6) won = true; 
      }
      // System.out.println( " " + ( won == true ? "You won!" : "You lost." ) ); 
      count = count + ( won ? 1 : 0 ); 
      times = times - 1; 
    }
    System.out.println( (double)count / Midterm.times ); 
  }
  public static int roll() {
    return (int)(Math.random() * 6) + 1;  
  }
}