import javax.swing.*; // program uses class Scanner

public class BPIH5E7
{
//die method 
public static int throw_die()
{return (int)(Math.random()*6+1);}
	
// main method 
public static void main( String args[] )
{ 
//die throw counting	             
int die=1;
boolean b=true;
int one=0,two=0,three=0,four=0,five=0,six=0;
int counter=0;
while(counter<10000000)
{ 
die=throw_die();
if(die==1) {one++;}
else if (die==2) {two++;}
else if (die==3) {three++;}
else if (die==4) {four++;}
else if (die==5) {five++;}
else if (die==6) {six++;}
counter++;
}//end of while
String s="Total of each die face : \n";
s+="1 : "+one+"\n";
s+="2 : "+two+"\n";
s+="3 : "+three+"\n";
s+="4 : "+four+"\n";
s+="5 : "+five+"\n";
s+="6 : "+six+"\n";
JOptionPane.showMessageDialog(null,s,"Total number of each die face",JOptionPane.PLAIN_MESSAGE); //display x and y
     } // end method main
} // end class BPIH4E11C
